Task #51937 - added.err

back to task #51937
download
Error: GCC_ANALYZER_WARNING (CWE-401):
erofs-utils-1.8.6/contrib/stress.c:127:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(subpath)’
erofs-utils-1.8.6/contrib/stress.c:762:5: enter_function: entry to ‘main’
erofs-utils-1.8.6/contrib/stress.c:769:12: branch_false: following ‘false’ branch...
erofs-utils-1.8.6/contrib/stress.c:775:15: branch_false: ...to here
erofs-utils-1.8.6/contrib/stress.c:775:15: call_function: calling ‘init_filetable’ from ‘main’
#  125|   	fep = &ftp->fents[ftp->nfiles++];
#  126|   	fep->subpath = strdup(subpath);
#  127|-> 	fep->fd = -1;
#  128|   	fep->chkfd = -1;
#  129|   	return fep;

Error: GCC_ANALYZER_WARNING (CWE-476):
erofs-utils-1.8.6/contrib/stress.c:758:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘freq_table’
erofs-utils-1.8.6/contrib/stress.c:752:22: acquire_memory: this call could return NULL
erofs-utils-1.8.6/contrib/stress.c:754:30: branch_true: following ‘true’ branch...
erofs-utils-1.8.6/contrib/stress.c:755:21: branch_true: ...to here
erofs-utils-1.8.6/contrib/stress.c:757:29: branch_true: following ‘true’ branch...
erofs-utils-1.8.6/contrib/stress.c:758:43: branch_true: ...to here
erofs-utils-1.8.6/contrib/stress.c:758:25: danger: ‘malloc((long unsigned int)f * 4) + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  756|   			continue;
#  757|   		for (f = 0; f < p->freq; f++, i++)
#  758|-> 			freq_table[i] = p - ops;
#  759|   	}
#  760|   }