giflib-5.2.2-1.fc41
List of Defects
Error: CPPCHECK_WARNING: [#def1]
giflib-5.2.2-build/giflib-5.2.2/dgif_lib.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def2]
giflib-5.2.2-build/giflib-5.2.2/dgif_lib.c:37:16: warning[core.NonNullParamChecker]: Null pointer passed to 4th parameter expecting 'nonnull'
# 35| return (((GifFilePrivateType *)gif->Private)->Read
# 36| ? ((GifFilePrivateType *)gif->Private)->Read(gif, buf, len)
# 37|-> : fread(buf, 1, len,
# 38| ((GifFilePrivateType *)gif->Private)->File));
# 39| }
Error: CPPCHECK_WARNING: [#def3]
giflib-5.2.2-build/giflib-5.2.2/egif_lib.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def4]
giflib-5.2.2-build/giflib-5.2.2/getarg.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-688): [#def5]
giflib-5.2.2-build/giflib-5.2.2/getarg.c: scope_hint: In function ‘GATestAllSatis’
giflib-5.2.2-build/giflib-5.2.2/getarg.c:220:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘LocalToken’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 218| if (LocalToken == NULL) {
# 219| LocalToken = (char *)malloc(3);
# 220|-> strcpy(LocalToken, "-?");
# 221| }
# 222|
Error: CLANG_WARNING: [#def6]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:232:39: warning[core.NullDereference]: Dereference of undefined pointer value
# 230| GASetParamCount(CtrlStr, i,
# 231| ParamCount); /* Point in correct param. */
# 232|-> *(int *)Parameters[(*ParamCount)++] = argv_end - *argv;
# 233| *(char ***)Parameters[(*ParamCount)++] = *(char ***)argv;
# 234| }
Error: CLANG_WARNING: [#def7]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:285:39: warning[core.NullDereference]: Dereference of undefined pointer value
# 283| i += 3;
# 284| /* Set boolean flag for that option. */
# 285|-> *(bool *)Parameters[(*ParamCount)++] = BooleanTrue;
# 286| if (ISSPACE(CtrlStrCopy[i])) {
# 287| return ARG_OK; /* Only a boolean flag is needed. */
Error: CLANG_WARNING: [#def8]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:420:14: warning[unix.Malloc]: Potential memory leak
# 418| case 'd': /* Format to read the parameters: */
# 419| TmpArray.IntArray[NumOfPrm] = xmalloc(sizeof(int));
# 420|-> ScanRes = sscanf(*((*argv)++), "%d",
# 421| (int *)TmpArray.IntArray[NumOfPrm++]);
# 422| break;
Error: CLANG_WARNING: [#def9]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:425:14: warning[unix.Malloc]: Potential memory leak
# 423| case 'u':
# 424| TmpArray.IntArray[NumOfPrm] = xmalloc(sizeof(int));
# 425|-> ScanRes = sscanf(
# 426| *((*argv)++), "%u",
# 427| (unsigned int *)TmpArray.IntArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def10]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:431:14: warning[unix.Malloc]: Potential memory leak
# 429| case 'o':
# 430| TmpArray.IntArray[NumOfPrm] = xmalloc(sizeof(int));
# 431|-> ScanRes = sscanf(
# 432| *((*argv)++), "%o",
# 433| (unsigned int *)TmpArray.IntArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def11]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:437:14: warning[unix.Malloc]: Potential memory leak
# 435| case 'x':
# 436| TmpArray.IntArray[NumOfPrm] = xmalloc(sizeof(int));
# 437|-> ScanRes = sscanf(
# 438| *((*argv)++), "%x",
# 439| (unsigned int *)TmpArray.IntArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def12]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:443:14: warning[unix.Malloc]: Potential memory leak
# 441| case 'D':
# 442| TmpArray.LngArray[NumOfPrm] = xmalloc(sizeof(long));
# 443|-> ScanRes = sscanf(*((*argv)++), "%ld",
# 444| (long *)TmpArray.IntArray[NumOfPrm++]);
# 445| break;
Error: CLANG_WARNING: [#def13]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:448:14: warning[unix.Malloc]: Potential memory leak
# 446| case 'U':
# 447| TmpArray.LngArray[NumOfPrm] = xmalloc(sizeof(long));
# 448|-> ScanRes = sscanf(
# 449| *((*argv)++), "%lu",
# 450| (unsigned long *)TmpArray.IntArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def14]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:454:14: warning[unix.Malloc]: Potential memory leak
# 452| case 'O':
# 453| TmpArray.LngArray[NumOfPrm] = xmalloc(sizeof(long));
# 454|-> ScanRes = sscanf(
# 455| *((*argv)++), "%lo",
# 456| (unsigned long *)TmpArray.IntArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def15]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:460:14: warning[unix.Malloc]: Potential memory leak
# 458| case 'X':
# 459| TmpArray.LngArray[NumOfPrm] = xmalloc(sizeof(long));
# 460|-> ScanRes = sscanf(
# 461| *((*argv)++), "%lx",
# 462| (unsigned long *)TmpArray.IntArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def16]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:467:8: warning[unix.Malloc]: Potential memory leak
# 465| TmpArray.FltArray[NumOfPrm] = xmalloc(sizeof(float));
# 466| ScanRes =
# 467|-> sscanf(*((*argv)++), "%f",
# 468| // cppcheck-suppress invalidPointerCast
# 469| (float *)TmpArray.LngArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def17]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:474:8: warning[unix.Malloc]: Potential memory leak
# 472| TmpArray.DblArray[NumOfPrm] = xmalloc(sizeof(double));
# 473| ScanRes =
# 474|-> sscanf(*((*argv)++), "%lf",
# 475| // cppcheck-suppress invalidPointerCast
# 476| (double *)TmpArray.LngArray[NumOfPrm++]);
Error: CLANG_WARNING: [#def18]
giflib-5.2.2-build/giflib-5.2.2/getarg.c:499:9: warning[unix.Malloc]: Use of memory allocated with size zero
# 497| *Ptemp++ = TmpArray.VoidArray[i];
# 498| }
# 499|-> *Ptemp = NULL; /* Close the block with NULL pointer. */
# 500|
# 501| /* That it save the number of parameters read as first parameter to
Error: CPPCHECK_WARNING: [#def19]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c: scope_hint: In function ‘LoadRGB’
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:154:1: warning[-Wanalyzer-file-leak]: leak of FILE
# 152| fclose(rgbfp[2]);
# 153| }
# 154|-> }
# 155|
# 156| /******************************************************************************
Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:154:1: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 152| fclose(rgbfp[2]);
# 153| }
# 154|-> }
# 155|
# 156| /******************************************************************************
Error: CLANG_WARNING: [#def22]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:303:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 301| }
# 302| for (i = 0; i < ScreenHeight; i++) {
# 303|-> GifRow = ScreenBuffer[i];
# 304| GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
# 305| for (j = 0, BufferP = Buffer; j < ScreenWidth; j++) {
Error: CLANG_WARNING: [#def23]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:307:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>=' is a garbage value
# 305| for (j = 0, BufferP = Buffer; j < ScreenWidth; j++) {
# 306| /* Check if color is within color palete */
# 307|-> if (GifRow[j] >= ColorMap->ColorCount) {
# 308| GIF_EXIT(GifErrorString(
# 309| D_GIF_ERR_IMAGE_DEFECT));
Error: CLANG_WARNING: [#def24]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:307:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>=' is a garbage value due to array index out of bounds
# 305| for (j = 0, BufferP = Buffer; j < ScreenWidth; j++) {
# 306| /* Check if color is within color palete */
# 307|-> if (GifRow[j] >= ColorMap->ColorCount) {
# 308| GIF_EXIT(GifErrorString(
# 309| D_GIF_ERR_IMAGE_DEFECT));
Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:327:30: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)ScreenWidth)’
# 325|
# 326| if ((Buffers[0] = (unsigned char *)malloc(ScreenWidth)) ==
# 327|-> NULL ||
# 328| (Buffers[1] = (unsigned char *)malloc(ScreenWidth)) ==
# 329| NULL ||
Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:329:30: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)ScreenWidth)’
# 327| NULL ||
# 328| (Buffers[1] = (unsigned char *)malloc(ScreenWidth)) ==
# 329|-> NULL ||
# 330| (Buffers[2] = (unsigned char *)malloc(ScreenWidth)) ==
# 331| NULL) {
Error: CLANG_WARNING: [#def27]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:337:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 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-401): [#def28]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:337:46: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)ScreenWidth)’
# 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: CLANG_WARNING: [#def29]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:340:22: warning[core.uninitialized.ArraySubscript]: Array subscript is undefined
# 338| GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
# 339| for (j = 0; j < ScreenWidth; j++) {
# 340|-> ColorMapEntry = &ColorMap->Colors[GifRow[j]];
# 341| Buffers[0][j] = ColorMapEntry->Red;
# 342| Buffers[1][j] = ColorMapEntry->Green;
Error: GCC_ANALYZER_WARNING (CWE-775): [#def30]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c: scope_hint: In function ‘DumpScreen2RGB’
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:359:1: warning[-Wanalyzer-file-leak]: leak of FILE
# 357| fclose(rgbfp[2]);
# 358| }
# 359|-> }
# 360|
# 361| static void GIF2RGB(int NumFiles, char *FileName, bool OneFileFlag,
Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
giflib-5.2.2-build/giflib-5.2.2/gif2rgb.c:359:1: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 357| fclose(rgbfp[2]);
# 358| }
# 359|-> }
# 360|
# 361| static void GIF2RGB(int NumFiles, char *FileName, bool OneFileFlag,
Error: CPPCHECK_WARNING: [#def32]
giflib-5.2.2-build/giflib-5.2.2/gif_font.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def33]
giflib-5.2.2-build/giflib-5.2.2/gifalloc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def34]
giflib-5.2.2-build/giflib-5.2.2/gifbg.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def35]
giflib-5.2.2-build/giflib-5.2.2/gifbuild.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def36]
giflib-5.2.2-build/giflib-5.2.2/gifclrmp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def37]
giflib-5.2.2-build/giflib-5.2.2/gifclrmp.c:171:6: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 169| * color map: */
# 170| DGifCloseFile(GifFileIn, NULL);
# 171|-> fclose(ColorFile);
# 172| exit(EXIT_SUCCESS);
# 173| }
Error: CPPCHECK_WARNING: [#def38]
giflib-5.2.2-build/giflib-5.2.2/gifcolor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def39]
giflib-5.2.2-build/giflib-5.2.2/gifecho.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def40]
giflib-5.2.2-build/giflib-5.2.2/giffix.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def41]
giflib-5.2.2-build/giflib-5.2.2/giffix.c:217:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'LineBuffer'
# 215| } while (RecordType != TERMINATE_RECORD_TYPE);
# 216|
# 217|-> if (DGifCloseFile(GifFileIn, &ErrorCode) == GIF_ERROR) {
# 218| PrintGifError(ErrorCode);
# 219| exit(EXIT_FAILURE);
Error: CPPCHECK_WARNING: [#def42]
giflib-5.2.2-build/giflib-5.2.2/gifhisto.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
giflib-5.2.2-build/giflib-5.2.2/gifhisto.c: scope_hint: In function ‘main’
giflib-5.2.2-build/giflib-5.2.2/gifhisto.c:252:41: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘Line’
# 250| }
# 251| for (j = 0; j < Size; j++) {
# 252|-> Line[j] = Color;
# 253| }
# 254| for (j = Size; j < ImageWidth; j++) {
Error: CPPCHECK_WARNING: [#def44]
giflib-5.2.2-build/giflib-5.2.2/gifinto.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def45]
giflib-5.2.2-build/giflib-5.2.2/giftext.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: COMPILER_WARNING: [#def46]
giflib-5.2.2-build/giflib-5.2.2/giftext.c: scope_hint: In function ‘PrintExtBlock’
giflib-5.2.2-build/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: [#def47]
giflib-5.2.2-build/giflib-5.2.2/giftext.c: scope_hint: In function ‘PrintPixelBlock’
giflib-5.2.2-build/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",
Error: CPPCHECK_WARNING: [#def48]
giflib-5.2.2-build/giflib-5.2.2/giftool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def49]
giflib-5.2.2-build/giflib-5.2.2/gifwedge.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def50]
giflib-5.2.2-build/giflib-5.2.2/quantize.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-14.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | giflib-5.2.2-1.fc41 |
store-results-to | /tmp/tmp2_lfq7ig/giflib-5.2.2-1.fc41.tar.xz |
time-created | 2024-07-03 12:49:47 |
time-finished | 2024-07-03 12:51:06 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp2_lfq7ig/giflib-5.2.2-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp2_lfq7ig/giflib-5.2.2-1.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |