Task #131508 - fixed.err

back to task #131508
download
Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_options.c: scope_hint: In function 'parse_option'
libarchive-3.8.4/libarchive/archive_options.c:179:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  179 |         p = strchr(opt, ',');
#      |           ^
#  177|   	val = "1";
#  178|   
#  179|-> 	p = strchr(opt, ',');
#  180|   
#  181|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_options.c:179:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  177|   	val = "1";
#  178|   
#  179|-> 	p = strchr(opt, ',');
#  180|   
#  181|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_options.c:194:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  194 |         p = strchr(opt, ':');
#      |           ^
#  192|   	}
#  193|   
#  194|-> 	p = strchr(opt, ':');
#  195|   	if (p != NULL) {
#  196|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_options.c:194:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  192|   	}
#  193|   
#  194|-> 	p = strchr(opt, ':');
#  195|   	if (p != NULL) {
#  196|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_options.c:201:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  201 |         p = strchr(opt, '=');
#      |           ^
#  199|   	}
#  200|   
#  201|-> 	p = strchr(opt, '=');
#  202|   	if (p != NULL) {
#  203|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_options.c:201:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  199|   	}
#  200|   
#  201|-> 	p = strchr(opt, '=');
#  202|   	if (p != NULL) {
#  203|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_pack_dev.c: scope_hint: In function 'pack_find'
libarchive-3.8.4/libarchive/archive_pack_dev.c:324:16: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  324 |         format = bsearch(name, formats,
#      |                ^
#  322|   	struct format	*format;
#  323|   
#  324|-> 	format = bsearch(name, formats,
#  325|   	    sizeof(formats)/sizeof(formats[0]),
#  326|   	    sizeof(formats[0]), compare_format);

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_pack_dev.c:324:16: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  322|   	struct format	*format;
#  323|   
#  324|-> 	format = bsearch(name, formats,
#  325|   	    sizeof(formats)/sizeof(formats[0]),
#  326|   	    sizeof(formats[0]), compare_format);

Error: GCC_ANALYZER_WARNING (CWE-688):
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:152:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc(signature_len)' where non-null expected
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:143:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:145:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:146:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:150:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:151:36: acquire_memory: this call could return NULL
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:152:17: danger: argument 1 ('malloc(signature_len)') from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected
#  150|   		state->signature_len = signature_len;
#  151|   		state->signature = malloc(signature_len);
#  152|-> 		memcpy(state->signature, signature, signature_len);
#  153|   	}
#  154|   

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c: scope_hint: In function 'readline'
libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c:2110:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2110 |                 nl = memchr(t, '\n', bytes_read);
#      |                    ^
# 2108|   		if (bytes_read < 0)
# 2109|   			return (ARCHIVE_FATAL);
# 2110|-> 		nl = memchr(t, '\n', bytes_read);
# 2111|   		/* If we found '\n', trim the read to end exactly there. */
# 2112|   		if (nl != NULL) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c:2110:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2108|   		if (bytes_read < 0)
# 2109|   			return (ARCHIVE_FATAL);
# 2110|-> 		nl = memchr(t, '\n', bytes_read);
# 2111|   		/* If we found '\n', trim the read to end exactly there. */
# 2112|   		if (nl != NULL) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c: scope_hint: In function 'readline'
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3549:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3549 |         p = memchr(t, '\n', bytes_read);
#      |           ^
# 3547|   		return (ARCHIVE_FATAL);
# 3548|   	s = t;  /* Start of line? */
# 3549|-> 	p = memchr(t, '\n', bytes_read);
# 3550|   	/* If we found '\n' in the read buffer, return pointer to that. */
# 3551|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3549:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3547|   		return (ARCHIVE_FATAL);
# 3548|   	s = t;  /* Start of line? */
# 3549|-> 	p = memchr(t, '\n', bytes_read);
# 3550|   	/* If we found '\n' in the read buffer, return pointer to that. */
# 3551|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3590:19: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3590 |                 p = memchr(t, '\n', bytes_read);
#      |                   ^
# 3588|   			return (ARCHIVE_FATAL);
# 3589|   		s = t;  /* Start of line? */
# 3590|-> 		p = memchr(t, '\n', bytes_read);
# 3591|   		/* If we found '\n', trim the read. */
# 3592|   		if (p != NULL) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3590:19: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3588|   			return (ARCHIVE_FATAL);
# 3589|   		s = t;  /* Start of line? */
# 3590|-> 		p = memchr(t, '\n', bytes_read);
# 3591|   		/* If we found '\n', trim the read. */
# 3592|   		if (p != NULL) {

Error: CPPCHECK_WARNING (CWE-457):
libarchive-3.8.4/libarchive/archive_util.c:461: error[uninitvar]: Uninitialized variable: rgid
#  459|   	if (getresgid(&ruid, &egid, &sgid) != 0)
#  460|   		return (-1);
#  461|-> 	if (rgid != egid || rgid != sgid)
#  462|   		return (1);
#  463|   #elif HAVE_GETEUID

Error: GCC_ANALYZER_WARNING (CWE-457):
libarchive-3.8.4/libarchive/archive_util.c:461:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'rgid'
libarchive-3.8.4/libarchive/archive_util.c:455:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_util.c:457:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_util.c:457:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_util.c:459:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_util.c:461:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_util.c:461:12: danger: use of uninitialized value 'rgid' here
#  459|   	if (getresgid(&ruid, &egid, &sgid) != 0)
#  460|   		return (-1);
#  461|-> 	if (rgid != egid || rgid != sgid)
#  462|   		return (1);
#  463|   #elif HAVE_GETEUID

Error: COMPILER_WARNING (CWE-457):
libarchive-3.8.4/libarchive/archive_util.c:461:12: warning[-Wmaybe-uninitialized]: 'rgid' may be used uninitialized
#  461 |         if (rgid != egid || rgid != sgid)
#      |            ^
libarchive-3.8.4/libarchive/archive_util.c: scope_hint: In function '__archive_get_tempdir'
libarchive-3.8.4/libarchive/archive_util.c:454:15: note: 'rgid' was declared here
#  454 |         gid_t rgid, egid, sgid;
#      |               ^~~~
#  459|   	if (getresgid(&ruid, &egid, &sgid) != 0)
#  460|   		return (-1);
#  461|-> 	if (rgid != egid || rgid != sgid)
#  462|   		return (1);
#  463|   #elif HAVE_GETEUID

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c: scope_hint: In function 'get_path_component'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5532:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 5532 |         p = strchr(fn, '/');
#      |           ^
# 5530|   	size_t l;
# 5531|   
# 5532|-> 	p = strchr(fn, '/');
# 5533|   	if (p == NULL) {
# 5534|   		if ((l = strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5532:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 5530|   	size_t l;
# 5531|   
# 5532|-> 	p = strchr(fn, '/');
# 5533|   	if (p == NULL) {
# 5534|   		if ((l = strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c: scope_hint: In function 'get_path_component'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2047:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2047 |         p = strchr(fn, '/');
#      |           ^
# 2045|   	size_t l;
# 2046|   
# 2047|-> 	p = strchr(fn, '/');
# 2048|   	if (p == NULL) {
# 2049|   		if ((l = strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2047:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2045|   	size_t l;
# 2046|   
# 2047|-> 	p = strchr(fn, '/');
# 2048|   	if (p == NULL) {
# 2049|   		if ((l = strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_warc.c: scope_hint: In function '_popul_ehdr'
libarchive-3.8.4/libarchive/archive_write_set_format_warc.c:374:29: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  374 |                 char *chk = strchr(hdr.tgturi, ':');
#      |                             ^~~~~~
#  372|   		static const char _fil[] = "file://";
#  373|   		const char *u;
#  374|-> 		char *chk = strchr(hdr.tgturi, ':');
#  375|   
#  376|   		if (chk != NULL && chk[1U] == '/' && chk[2U] == '/') {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_warc.c:374:29: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  372|   		static const char _fil[] = "file://";
#  373|   		const char *u;
#  374|-> 		char *chk = strchr(hdr.tgturi, ':');
#  375|   
#  376|   		if (chk != NULL && chk[1U] == '/' && chk[2U] == '/') {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c: scope_hint: In function 'get_path_component'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2276:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2276 |         p = strchr(fn, '/');
#      |           ^
# 2274|   	int l;
# 2275|   
# 2276|-> 	p = strchr(fn, '/');
# 2277|   	if (p == NULL) {
# 2278|   		if ((l = (int)strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2276:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2274|   	int l;
# 2275|   
# 2276|-> 	p = strchr(fn, '/');
# 2277|   	if (p == NULL) {
# 2278|   		if ((l = (int)strlen(fn)) == 0)

Error: CPPCHECK_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:350: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  348|   {
#  349|       struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
#  350|->     state->seed = seed;
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;

Error: GCC_ANALYZER_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:350:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'state'
libarchive-3.8.4/libarchive/xxhash.c:363:19: acquire_memory: this call could return NULL
libarchive-3.8.4/libarchive/xxhash.c:364:5: call_function: inlined call to 'XXH32_resetState' from 'XXH32_init'
#  348|   {
#  349|       struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
#  350|->     state->seed = seed;
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;

Error: CPPCHECK_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:351: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  349|       struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
#  350|       state->seed = seed;
#  351|->     state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;
#  353|       state->v3 = seed + 0;

Error: CPPCHECK_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:352: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  350|       state->seed = seed;
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|->     state->v2 = seed + PRIME32_2;
#  353|       state->v3 = seed + 0;
#  354|       state->v4 = seed - PRIME32_1;

Error: CPPCHECK_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:353: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;
#  353|->     state->v3 = seed + 0;
#  354|       state->v4 = seed - PRIME32_1;
#  355|       state->total_len = 0;

Error: CPPCHECK_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:354: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  352|       state->v2 = seed + PRIME32_2;
#  353|       state->v3 = seed + 0;
#  354|->     state->v4 = seed - PRIME32_1;
#  355|       state->total_len = 0;
#  356|       state->memsize = 0;

Error: CPPCHECK_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:355: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  353|       state->v3 = seed + 0;
#  354|       state->v4 = seed - PRIME32_1;
#  355|->     state->total_len = 0;
#  356|       state->memsize = 0;
#  357|       return XXH_OK;

Error: CPPCHECK_WARNING (CWE-476):
libarchive-3.8.4/libarchive/xxhash.c:356: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  354|       state->v4 = seed - PRIME32_1;
#  355|       state->total_len = 0;
#  356|->     state->memsize = 0;
#  357|       return XXH_OK;
#  358|   }

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/tar/bsdtar.c: scope_hint: In function ‘main’
libarchive-3.8.4/tar/bsdtar.c:381:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  381 |                         uptr = strchr(bsdtar->argument, ':');
#      |                              ^
#  379|   			tptr = NULL;
#  380|   
#  381|-> 			uptr = strchr(bsdtar->argument, ':');
#  382|   			if (uptr != NULL) {
#  383|   				if (uptr[1] == '\0') {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/tar/bsdtar.c:381:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  379|   			tptr = NULL;
#  380|   
#  381|-> 			uptr = strchr(bsdtar->argument, ':');
#  382|   			if (uptr != NULL) {
#  383|   				if (uptr[1] == '\0') {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/tar/bsdtar.c:660:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  660 |                         uptr = strchr(bsdtar->argument, ':');
#      |                              ^
#  658|   			tptr = NULL;
#  659|   
#  660|-> 			uptr = strchr(bsdtar->argument, ':');
#  661|   			if (uptr != NULL) {
#  662|   				if (uptr[1] == 0) {

Error: COMPILER_WARNING (CWE-704):
libarchive-3.8.4/tar/bsdtar.c:660:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  658|   			tptr = NULL;
#  659|   
#  660|-> 			uptr = strchr(bsdtar->argument, ':');
#  661|   			if (uptr != NULL) {
#  662|   				if (uptr[1] == 0) {