Error: CPPCHECK_WARNING (CWE-476): [#def1] giflib-5.2.2/getarg.c:220: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: LocalToken # 218| if (LocalToken == NULL) { # 219| LocalToken = (char *)malloc(3); # 220|-> strcpy(LocalToken, "-?"); # 221| } # 222| Error: GCC_ANALYZER_WARNING (CWE-688): [#def2] giflib-5.2.2/getarg.c:220:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘LocalToken’ where non-null expected giflib-5.2.2/getarg.c:218:12: branch_true: following ‘true’ branch... giflib-5.2.2/getarg.c:219:38: branch_true: ...to here giflib-5.2.2/getarg.c:219:38: acquire_memory: this call could return NULL giflib-5.2.2/getarg.c:220:17: danger: argument 1 (‘malloc(3)’) from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected #argument 1 of ‘__builtin_memcpy’ must be non-null # 218| if (LocalToken == NULL) { # 219| LocalToken = (char *)malloc(3); # 220|-> strcpy(LocalToken, "-?"); # 221| } # 222| Error: GCC_ANALYZER_WARNING (CWE-775): [#def3] giflib-5.2.2/gif2rgb.c:154:1: warning[-Wanalyzer-file-leak]: leak of FILE giflib-5.2.2/gif2rgb.c:547:5: enter_function: entry to ‘main’ giflib-5.2.2/gif2rgb.c:554:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:558:14: branch_false: ...to here giflib-5.2.2/gif2rgb.c:569:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:574:13: branch_false: ...to here giflib-5.2.2/gif2rgb.c:578:12: branch_true: following ‘true’ branch... giflib-5.2.2/gif2rgb.c:579:22: branch_true: ...to here giflib-5.2.2/gif2rgb.c:579:20: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:584:17: call_function: calling ‘RGB2GIF’ from ‘main’ # 152| fclose(rgbfp[2]); # 153| } # 154|-> } # 155| # 156| /****************************************************************************** Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] giflib-5.2.2/gif2rgb.c:154:1: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ giflib-5.2.2/gif2rgb.c:547:5: enter_function: entry to ‘main’ giflib-5.2.2/gif2rgb.c:554:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:558:14: branch_false: ...to here giflib-5.2.2/gif2rgb.c:569:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:574:13: branch_false: ...to here giflib-5.2.2/gif2rgb.c:578:12: branch_true: following ‘true’ branch... giflib-5.2.2/gif2rgb.c:579:22: branch_true: ...to here giflib-5.2.2/gif2rgb.c:579:20: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:584:17: call_function: calling ‘RGB2GIF’ from ‘main’ # 152| fclose(rgbfp[2]); # 153| } # 154|-> } # 155| # 156| /****************************************************************************** Error: GCC_ANALYZER_WARNING (CWE-401): [#def5] giflib-5.2.2/gif2rgb.c:326:21: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)ScreenWidth)’ giflib-5.2.2/gif2rgb.c:547:5: enter_function: entry to ‘main’ giflib-5.2.2/gif2rgb.c:554:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:558:14: branch_false: ...to here giflib-5.2.2/gif2rgb.c:569:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:574:13: branch_false: ...to here giflib-5.2.2/gif2rgb.c:574:12: branch_true: following ‘true’ branch... giflib-5.2.2/gif2rgb.c:578:13: branch_true: ...to here giflib-5.2.2/gif2rgb.c:578:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:587:17: branch_false: ...to here giflib-5.2.2/gif2rgb.c:587:17: call_function: calling ‘GIF2RGB’ from ‘main’ # 324| unsigned char *Buffers[3]; # 325| # 326|-> if ((Buffers[0] = (unsigned char *)malloc(ScreenWidth)) == # 327| NULL || # 328| (Buffers[1] = (unsigned char *)malloc(ScreenWidth)) == Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] giflib-5.2.2/gif2rgb.c:326:21: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)ScreenWidth)’ giflib-5.2.2/gif2rgb.c:547:5: enter_function: entry to ‘main’ giflib-5.2.2/gif2rgb.c:554:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:558:14: branch_false: ...to here giflib-5.2.2/gif2rgb.c:569:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:574:13: branch_false: ...to here giflib-5.2.2/gif2rgb.c:574:12: branch_true: following ‘true’ branch... giflib-5.2.2/gif2rgb.c:578:13: branch_true: ...to here giflib-5.2.2/gif2rgb.c:578:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:587:17: branch_false: ...to here giflib-5.2.2/gif2rgb.c:587:17: call_function: calling ‘GIF2RGB’ from ‘main’ # 324| unsigned char *Buffers[3]; # 325| # 326|-> if ((Buffers[0] = (unsigned char *)malloc(ScreenWidth)) == # 327| NULL || # 328| (Buffers[1] = (unsigned char *)malloc(ScreenWidth)) == Error: GCC_ANALYZER_WARNING (CWE-401): [#def7] giflib-5.2.2/gif2rgb.c:337:46: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)ScreenWidth)’ giflib-5.2.2/gif2rgb.c:547:5: enter_function: entry to ‘main’ giflib-5.2.2/gif2rgb.c:554:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:558:14: branch_false: ...to here giflib-5.2.2/gif2rgb.c:569:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:574:13: branch_false: ...to here giflib-5.2.2/gif2rgb.c:574:12: branch_true: following ‘true’ branch... giflib-5.2.2/gif2rgb.c:578:13: branch_true: ...to here giflib-5.2.2/gif2rgb.c:578:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:587:17: branch_false: ...to here giflib-5.2.2/gif2rgb.c:587:17: call_function: calling ‘GIF2RGB’ from ‘main’ # 335| # 336| for (i = 0; i < ScreenHeight; i++) { # 337|-> GifRow = ScreenBuffer[i]; # 338| GifQprintf("\b\b\b\b%-4d", ScreenHeight - i); # 339| for (j = 0; j < ScreenWidth; j++) { Error: GCC_ANALYZER_WARNING (CWE-775): [#def8] giflib-5.2.2/gif2rgb.c:364:1: warning[-Wanalyzer-file-leak]: leak of FILE giflib-5.2.2/gif2rgb.c:547:5: enter_function: entry to ‘main’ giflib-5.2.2/gif2rgb.c:554:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:558:14: branch_false: ...to here giflib-5.2.2/gif2rgb.c:569:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:574:13: branch_false: ...to here giflib-5.2.2/gif2rgb.c:574:12: branch_true: following ‘true’ branch... giflib-5.2.2/gif2rgb.c:578:13: branch_true: ...to here giflib-5.2.2/gif2rgb.c:578:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:587:17: branch_false: ...to here giflib-5.2.2/gif2rgb.c:587:17: call_function: calling ‘GIF2RGB’ from ‘main’ # 362| fclose(rgbfp[2]); # 363| } # 364|-> } # 365| # 366| static void GIF2RGB(int NumFiles, char *FileName, bool OneFileFlag, Error: GCC_ANALYZER_WARNING (CWE-401): [#def9] giflib-5.2.2/gif2rgb.c:364:1: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ giflib-5.2.2/gif2rgb.c:547:5: enter_function: entry to ‘main’ giflib-5.2.2/gif2rgb.c:554:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:558:14: branch_false: ...to here giflib-5.2.2/gif2rgb.c:569:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:574:13: branch_false: ...to here giflib-5.2.2/gif2rgb.c:574:12: branch_true: following ‘true’ branch... giflib-5.2.2/gif2rgb.c:578:13: branch_true: ...to here giflib-5.2.2/gif2rgb.c:578:12: branch_false: following ‘false’ branch... giflib-5.2.2/gif2rgb.c:587:17: branch_false: ...to here giflib-5.2.2/gif2rgb.c:587:17: call_function: calling ‘GIF2RGB’ from ‘main’ # 362| fclose(rgbfp[2]); # 363| } # 364|-> } # 365| # 366| static void GIF2RGB(int NumFiles, char *FileName, bool OneFileFlag, Error: GCC_ANALYZER_WARNING (CWE-476): [#def10] giflib-5.2.2/gifhisto.c:252:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘Line’ giflib-5.2.2/gifhisto.c:57:12: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:61:14: branch_false: ...to here giflib-5.2.2/gifhisto.c:72:12: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:78:12: branch_false: ...to here giflib-5.2.2/gifhisto.c:86:20: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:92:9: branch_false: ...to here giflib-5.2.2/gifhisto.c:92:21: branch_true: following ‘true’ branch (when ‘i != 256’)... giflib-5.2.2/gifhisto.c:93:17: branch_true: ...to here giflib-5.2.2/gifhisto.c:97:20: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:101:17: branch_false: ...to here giflib-5.2.2/gifhisto.c:198:12: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:204:13: branch_false: ...to here giflib-5.2.2/gifhisto.c:204:12: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:212:35: branch_false: ...to here giflib-5.2.2/gifhisto.c:212:20: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:220:39: branch_false: ...to here giflib-5.2.2/gifhisto.c:218:20: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:226:21: branch_false: ...to here giflib-5.2.2/gifhisto.c:226:20: branch_false: following ‘false’ branch... giflib-5.2.2/gifhisto.c:234:36: branch_false: ...to here giflib-5.2.2/gifhisto.c:234:36: acquire_memory: this call could return NULL giflib-5.2.2/gifhisto.c:245:61: branch_true: following ‘true’ branch (when ‘i < NumColors’)... giflib-5.2.2/gifhisto.c:248:37: branch_true: ...to here giflib-5.2.2/gifhisto.c:251:37: branch_true: following ‘true’ branch... giflib-5.2.2/gifhisto.c:252:37: branch_true: ...to here giflib-5.2.2/gifhisto.c:252:33: danger: ‘Line + (sizetype)j’ could be NULL: unchecked value from [(21)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/20) # 250| } # 251| for (j = 0; j < Size; j++) { # 252|-> Line[j] = Color; # 253| } # 254| for (j = Size; j < ImageWidth; j++) { Error: COMPILER_WARNING: [#def11] giflib-5.2.2/giftext.c: scope_hint: In function ‘PrintExtBlock’ giflib-5.2.2/giftext.c:443:74: warning[-Wformat-truncation=]: ‘__snprintf_chk’ output truncated before the last format character # 443 | (void)snprintf(&HexForm[CrntPlace * 3], 3, " %02x", # | ^ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 4 bytes into a destination of size 3 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 441| Len = Extension[0]; # 442| for (i = 1; i <= Len; i++) { # 443|-> (void)snprintf(&HexForm[CrntPlace * 3], 3, " %02x", # 444| Extension[i]); # 445| (void)snprintf(&AsciiForm[CrntPlace], 3, "%c", Error: COMPILER_WARNING: [#def12] giflib-5.2.2/giftext.c: scope_hint: In function ‘PrintPixelBlock’ giflib-5.2.2/giftext.c:489:66: warning[-Wformat-truncation=]: ‘__snprintf_chk’ output truncated before the last format character # 489 | (void)snprintf(&HexForm[CrntPlace * 3], 3, " %02x", # | ^ /usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output 4 bytes into a destination of size 3 # 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69 | __glibc_objsize (__s), __fmt, # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 70 | __va_arg_pack ()); # | ~~~~~~~~~~~~~~~~~ # 487| # 488| for (i = 0; i < Len; i++) { # 489|-> (void)snprintf(&HexForm[CrntPlace * 3], 3, " %02x", # 490| PixelBlock[i]); # 491| (void)snprintf(&AsciiForm[CrntPlace], 3, "%c",
analyzer-version-clippy | 1.86.0 |
analyzer-version-cppcheck | 2.17.1 |
analyzer-version-gcc | 15.0.1 |
analyzer-version-gcc-analyzer | 15.0.1 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-22.us-west-2.compute.internal |
known-false-positives | /usr/share/csmock/known-false-positives.js |
known-false-positives-rpm | known-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch |
mock-config | fedora-rawhide-x86_64 |
project-name | giflib-5.2.2-6.fc43 |
store-results-to | /tmp/tmpb_7oiilk/giflib-5.2.2-6.fc43.tar.xz |
time-created | 2025-04-25 12:36:15 |
time-finished | 2025-04-25 12:37:50 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpb_7oiilk/giflib-5.2.2-6.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpb_7oiilk/giflib-5.2.2-6.fc43.src.rpm' |
tool-version | csmock-3.8.1.20250422.172604.g26bc3d6-1.el9 |