2024-04-21 18:30 ftp://ftp.de.debian.org/debian/pool/main/r/r-cran-zip/r-cran-zip_2.3.1.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning -D__GNUC__ --platform=unix64 -j1 platform: Linux-5.15.0-105-generic-x86_64-with-glibc2.35 python: 3.10.12 client-version: 1.3.56 compiler: g++ (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0 cppcheck: head 2.14.0 head-info: ea2e716 (2024-04-21 15:59:20 +0200) count: 105 105 elapsed-time: 44.3 45.2 head-timing-info: old-timing-info: head results: zip/src/init.c:29:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FALSE [valueFlowBailoutIncompleteVar] zip/src/miniz.c:2536:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable m_look_up [valueFlowBailoutIncompleteVar] zip/src/miniz.c:3755:51: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EOF [valueFlowBailoutIncompleteVar] zip/src/miniz.c:5051:29: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EOF [valueFlowBailoutIncompleteVar] zip/src/miniz.c:5537:47: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EOF [valueFlowBailoutIncompleteVar] zip/src/miniz.c:7163:61: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EOF [valueFlowBailoutIncompleteVar] zip/src/miniz.c:0:0: debug: ValueFlow maximum iterations exceeded [valueFlowMaxIterations] zip/src/miniz.c:3291:21: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] zip/src/miniz.c:3323:13: style: Obsolescent function 'utime' called. It is recommended to use 'utimensat' instead. [prohibitedutimeCalled] zip/src/miniz.c:3653:21: warning: Identical inner 'if' condition is always true. [identicalInnerCondition] zip/src/miniz.c:3651:50: note: 'extra_size_remaining' is assigned value 'ext_data_size' here. zip/src/miniz.c:3647:18: note: outer condition: ext_data_size zip/src/miniz.c:3653:21: note: identical inner condition: extra_size_remaining zip/src/miniz.c:215:51: style: Condition 'tdefl_init(pComp,NULL,NULL,comp_flags)!=TDEFL_STATUS_OKAY' is always false [knownConditionTrueFalse] zip/src/miniz.c:215:19: note: Calling function 'tdefl_init' returns 0 zip/src/miniz.c:215:51: note: Condition 'tdefl_init(pComp,NULL,NULL,comp_flags)!=TDEFL_STATUS_OKAY' is always false zip/src/miniz.c:1965:73: style: Condition 'tdefl_init(pComp,pPut_buf_func,pPut_buf_user,flags)==TDEFL_STATUS_OKAY' is always true [knownConditionTrueFalse] zip/src/miniz.c:1965:28: note: Calling function 'tdefl_init' returns 0 zip/src/miniz.c:1965:73: note: Condition 'tdefl_init(pComp,pPut_buf_func,pPut_buf_user,flags)==TDEFL_STATUS_OKAY' is always true zip/src/miniz.c:5955:9: style: Condition '!mz_zip_writer_create_central_dir_header(pZip,central_dir_header,filename_size,(unsigned short)(extra_size+user_extra_data_len),comment_size,uncomp_size,comp_size,uncomp_crc32,method,bit_flags,dos_time,dos_date,local_header_ofs,ext_attributes)' is always false [knownConditionTrueFalse] zip/src/miniz.c:5955:49: note: Calling function 'mz_zip_writer_create_central_dir_header' returns 1 zip/src/miniz.c:5955:9: note: Condition '!mz_zip_writer_create_central_dir_header(pZip,central_dir_header,filename_size,(unsigned short)(extra_size+user_extra_data_len),comment_size,uncomp_size,comp_size,uncomp_crc32,method,bit_flags,dos_time,dos_date,local_header_ofs,ext_attributes)' is always false zip/src/miniz.c:6179:13: style: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)(extra_size+user_extra_data_len),0,0,0,method,bit_flags,dos_time,dos_date)' is always false [knownConditionTrueFalse] zip/src/miniz.c:6179:51: note: Calling function 'mz_zip_writer_create_local_dir_header' returns 1 zip/src/miniz.c:6179:13: note: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)(extra_size+user_extra_data_len),0,0,0,method,bit_flags,dos_time,dos_date)' is always false zip/src/miniz.c:6206:13: style: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)user_extra_data_len,0,0,0,method,bit_flags,dos_time,dos_date)' is always false [knownConditionTrueFalse] zip/src/miniz.c:6206:51: note: Calling function 'mz_zip_writer_create_local_dir_header' returns 1 zip/src/miniz.c:6206:13: note: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)user_extra_data_len,0,0,0,method,bit_flags,dos_time,dos_date)' is always false zip/src/miniz.c:6249:150: style: Condition 'tdefl_init(pComp,mz_zip_writer_add_put_buf_callback,&state,tdefl_create_comp_flags_from_zip_params(level,-15,MZ_DEFAULT_STRATEGY))!=TDEFL_STATUS_OKAY' is always false [knownConditionTrueFalse] zip/src/miniz.c:6249:24: note: Calling function 'tdefl_init' returns 0 zip/src/miniz.c:6249:150: note: Condition 'tdefl_init(pComp,mz_zip_writer_add_put_buf_callback,&state,tdefl_create_comp_flags_from_zip_params(level,-15,MZ_DEFAULT_STRATEGY))!=TDEFL_STATUS_OKAY' is always false zip/src/miniz.c:6426:13: style: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)(extra_size+user_extra_data_len),0,0,0,method,gen_flags,dos_time,dos_date)' is always false [knownConditionTrueFalse] zip/src/miniz.c:6426:51: note: Calling function 'mz_zip_writer_create_local_dir_header' returns 1 zip/src/miniz.c:6426:13: note: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)(extra_size+user_extra_data_len),0,0,0,method,gen_flags,dos_time,dos_date)' is always false zip/src/miniz.c:6450:13: style: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)user_extra_data_len,0,0,0,method,gen_flags,dos_time,dos_date)' is always false [knownConditionTrueFalse] zip/src/miniz.c:6450:51: note: Calling function 'mz_zip_writer_create_local_dir_header' returns 1 zip/src/miniz.c:6450:13: note: Condition '!mz_zip_writer_create_local_dir_header(pZip,local_dir_header,(unsigned short)archive_name_size,(unsigned short)user_extra_data_len,0,0,0,method,gen_flags,dos_time,dos_date)' is always false zip/src/miniz.c:6514:153: style: Condition 'tdefl_init(pComp,mz_zip_writer_add_put_buf_callback,&state,tdefl_create_comp_flags_from_zip_params(level,-15,MZ_DEFAULT_STRATEGY))!=TDEFL_STATUS_OKAY' is always false [knownConditionTrueFalse] zip/src/miniz.c:6514:27: note: Calling function 'tdefl_init' returns 0 zip/src/miniz.c:6514:153: note: Condition 'tdefl_init(pComp,mz_zip_writer_add_put_buf_callback,&state,tdefl_create_comp_flags_from_zip_params(level,-15,MZ_DEFAULT_STRATEGY))!=TDEFL_STATUS_OKAY' is always false zip/src/miniz.c:6030:38: warning: Either the condition '!pZip' is redundant or there is possible null pointer dereference: pZip. [nullPointerRedundantCheck] zip/src/miniz.c:6053:10: note: Assuming that condition '!pZip' is not redundant zip/src/miniz.c:6030:38: note: Null pointer dereference zip/src/miniz.c:6317:60: warning: Either the condition '!pZip' is redundant or there is possible null pointer dereference: pZip. [nullPointerRedundantCheck] zip/src/miniz.c:6333:10: note: Assuming that condition '!pZip' is not redundant zip/src/miniz.c:6317:60: note: Null pointer dereference zip/src/miniz.c:2352:81: error: Pointer addition with NULL pointer. [nullPointerArithmetic] zip/src/miniz.c:2818:137: note: Calling function 'tinfl_decompress', 5th argument 'pBuf?(unsigned char*)pBuf+*pOut_len:NULL' value is 0 zip/src/miniz.c:2352:81: note: Null pointer addition zip/src/miniz.c:6030:15: style:inconclusive: Same expression used in consecutive assignments of 'local_dir_header_ofs' and 'cur_archive_file_ofs'. [duplicateAssignExpression] zip/src/miniz.c:6030:60: note: Same expression used in consecutive assignments of 'local_dir_header_ofs' and 'cur_archive_file_ofs'. zip/src/miniz.c:6030:15: note: Same expression used in consecutive assignments of 'local_dir_header_ofs' and 'cur_archive_file_ofs'. zip/src/miniz.c:1246:9: style: Unsigned expression '(1U<m_num_bits [uninitvar] zip/src/miniz.c:4419:35: note: Calling function 'tinfl_decompress', 1st argument '&inflator' value is zip/src/miniz.c:2356:55: note: Assuming condition is false zip/src/miniz.c:2362:19: note: Uninitialized variable: r->m_num_bits zip/src/miniz.c:3512:44: style: Variable 'zip64_end_of_central_dir_ofs' is assigned a value that is never used. [unreadVariable] zip/src/miniz.c:4147:37: style: Variable 'pField_data' is assigned a value that is never used. [unreadVariable] zip/src/miniz.c:4148:46: style: Variable 'field_data_remaining' is assigned a value that is never used. [unreadVariable] zip/src/miniz.c:4598:26: style: Variable 'cur_file_ofs' is assigned a value that is never used. [unreadVariable] zip/src/miniz.c:4600:28: style: Variable 'comp_remaining' is assigned a value that is never used. [unreadVariable] zip/src/miniz.c:6854:42: style: Variable 'local_header_uncomp_size' is assigned a value that is never used. [unreadVariable] zip/src/miniz.c:6855:40: style: Variable 'local_header_comp_size' is assigned a value that is never used. [unreadVariable] zip/src/miniz.c:6984:26: style: Variable 'cur_src_file_ofs' is assigned a value that is never used. [unreadVariable] zip/src/rzip.c:22:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] zip/src/rzip.c:132:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] zip/src/rzip.c:157:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] zip/src/rzip.c:251:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] zip/src/rzip.c:260:36: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable VECSXP [valueFlowBailoutIncompleteVar] zip/src/rzip.c:334:36: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable VECSXP [valueFlowBailoutIncompleteVar] zip/src/rzip.c:45:9: style: Condition 'uzipfile' is always false [knownConditionTrueFalse] zip/src/rzip.c:27:23: note: Assignment 'uzipfile=NULL', assigned value is 0 zip/src/rzip.c:45:9: note: Condition 'uzipfile' is always false zip/src/rzip.c:312:16: style: Condition 'status!=MZ_OK' is always true [knownConditionTrueFalse] zip/src/rzip.c:394:16: style: Condition 'status!=MZ_OK' is always true [knownConditionTrueFalse] zip/src/rzip.c:57:5: error: Memory pointed to by 'uzipfile' is freed twice. [doubleFree] zip/src/rzip.c:45:19: note: Memory pointed to by 'uzipfile' is freed twice. zip/src/rzip.c:57:5: note: Memory pointed to by 'uzipfile' is freed twice. zip/src/rzip.c:49:17: warning: Either the condition 'fh==NULL' is redundant or there is possible null pointer dereference: fh. [nullPointerRedundantCheck] zip/src/rzip.c:44:10: note: Assuming that condition 'fh==NULL' is not redundant zip/src/rzip.c:49:17: note: Null pointer dereference zip/src/rzip.c:50:39: warning: Either the condition 'fh==NULL' is redundant or there is possible null pointer dereference: fh. [nullPointerRedundantCheck] zip/src/rzip.c:44:10: note: Assuming that condition 'fh==NULL' is not redundant zip/src/rzip.c:50:39: note: Null pointer dereference zip/src/rzip.c:51:17: warning: Either the condition 'fh==NULL' is redundant or there is possible null pointer dereference: fh. [nullPointerRedundantCheck] zip/src/rzip.c:44:10: note: Assuming that condition 'fh==NULL' is not redundant zip/src/rzip.c:51:17: note: Null pointer dereference zip/src/tools/cmdunzip.c:20:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] zip/src/tools/cmdunzip.c:32:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] zip/src/tools/cmdunzip.c:58:14: style: The comparison 'retval != 0' is always false. [knownConditionTrueFalse] zip/src/tools/cmdunzip.c:30:16: note: 'retval' is assigned value '0' here. zip/src/tools/cmdunzip.c:58:14: note: The comparison 'retval != 0' is always false. zip/src/tools/cmdunzip.c:47:9: style: Variable 'zipfile' can be declared as pointer to const [constVariablePointer] zip/src/tools/cmdunzip.c:48:9: style: Variable 'exdir' can be declared as pointer to const [constVariablePointer] zip/src/tools/cmdzip.c:21:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] zip/src/tools/cmdzip.c:42:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] zip/src/tools/cmdzip.c:107:9: style: Variable 'fn' can be declared as pointer to const [constVariablePointer] zip/src/unixutils.c:54:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] zip/src/unixutils.c:83:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable tv_sec [valueFlowBailoutIncompleteVar] zip/src/unixutils.c:85:10: style: Obsolescent function 'utimes' called. It is recommended to use 'utimensat' instead. [prohibitedutimesCalled] zip/src/unixutils.c:91:13: style: Condition '*size==-1' is always false [knownConditionTrueFalse] zip/src/unixutils.c:13:44: style: Parameter 'buffer_size' can be declared as pointer to const [constParameterPointer] zip/src/unixutils.c:76:27: style: Parameter 'filename' can be declared as pointer to const [constParameterPointer] zip/src/winutils.c:15:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CP_UTF8 [valueFlowBailoutIncompleteVar] zip/src/winutils.c:51:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CP_UTF8 [valueFlowBailoutIncompleteVar] zip/src/winutils.c:97:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CP_UTF8 [valueFlowBailoutIncompleteVar] zip/src/winutils.c:194:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ERROR_ALREADY_EXISTS [valueFlowBailoutIncompleteVar] zip/src/winutils.c:215:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable INVALID_FILE_ATTRIBUTES [valueFlowBailoutIncompleteVar] zip/src/winutils.c:238:33: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable GENERIC_WRITE [valueFlowBailoutIncompleteVar] zip/src/winutils.c:225:11: portability: Non reentrant function 'gmtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'gmtime_r'. [prohibitedgmtimeCalled] zip/src/winutils.c:250:13: style: Condition '*size==-1' is always false [knownConditionTrueFalse] zip/src/winutils.c:166:13: style: Variable 'err' is assigned a value that is never used. [unreadVariable] zip/src/zip.c:54:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] zip/src/zip.c:206:18: warning: Either the condition 'buffer' is redundant or there is possible null pointer dereference: buffer. [nullPointerRedundantCheck] zip/src/zip.c:210:13: note: Assuming that condition 'buffer' is not redundant zip/src/zip.c:206:18: note: Null pointer dereference zip/src/zip.c:231:17: warning: Either the condition 'buffer' is redundant or there is possible null pointer dereference: buffer. [nullPointerRedundantCheck] zip/src/zip.c:233:13: note: Assuming that condition 'buffer' is not redundant zip/src/zip.c:231:17: note: Null pointer dereference zip/src/zip.c:126:52: style:inconclusive: Function 'zip_unzip' argument 6 names different: declaration 'exdir' definition 'cexdir'. [funcArgNamesDifferent] zip/src/zip.h:47:52: note: Function 'zip_unzip' argument 6 names different: declaration 'exdir' definition 'cexdir'. zip/src/zip.c:126:52: note: Function 'zip_unzip' argument 6 names different: declaration 'exdir' definition 'cexdir'. zip/src/zip.c:279:32: style: Parameter 'cdirs' can be declared as pointer to const [constParameterPointer] zip/src/zip.c:279:47: style: Parameter 'cmtimes' can be declared as pointer to const [constParameterPointer] zip/src/zip.c:59:1: error: va_list 'va' was opened but not closed by va_end(). [va_end_missing] zip/src/unixutils.c:85:17: warning: Null pointer dereference: filename [ctunullpointer] zip/src/zip.c:263:11: note: Assuming that condition 'buffer' is not redundant zip/src/zip.c:262:22: note: Calling function zip_set_mtime, 1st argument is null zip/src/unixutils.c:85:17: note: Dereferencing argument filename that is null diff: DONE