Error: CPPCHECK_WARNING (CWE-476): [#def1] fontconfig-2.16.2/meson-cc-tests/flexible-array-member-test.c:15: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p # 13| int m = getchar(); # 14| struct s *p = malloc (offsetof (struct s, d) + m * sizeof (double)); # 15|-> p->d[0] = 0.0; # 16| return p->d != (double *)NULL; # 17| } Error: CPPCHECK_WARNING (CWE-401): [#def2] fontconfig-2.16.2/meson-cc-tests/flexible-array-member-test.c:16: error[memleak]: Memory leak: p # 14| struct s *p = malloc (offsetof (struct s, d) + m * sizeof (double)); # 15| p->d[0] = 0.0; # 16|-> return p->d != (double *)NULL; # 17| } Error: CPPCHECK_WARNING (CWE-476): [#def3] fontconfig-2.16.2/meson-cc-tests/flexible-array-member-test.c:16: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: p # 14| struct s *p = malloc (offsetof (struct s, d) + m * sizeof (double)); # 15| p->d[0] = 0.0; # 16|-> return p->d != (double *)NULL; # 17| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] fontconfig-2.16.2/redhat-linux-build/../fc-list/fc-list.c:141:49: warning[-Wanalyzer-malloc-leak]: leak of ‘format’ fontconfig-2.16.2/redhat-linux-build/../fc-list/fc-list.c:128:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-list/fc-list.c:133:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-list/fc-list.c:141:49: acquire_memory: allocated here fontconfig-2.16.2/redhat-linux-build/../fc-list/fc-list.c:128:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-list/fc-list.c:133:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-list/fc-list.c:141:49: danger: ‘format’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 139| break; # 140| case 'f': # 141|-> format_optarg = format = (FcChar8 *)strdup (optarg); # 142| break; # 143| case 'q': Error: GCC_ANALYZER_WARNING (CWE-401): [#def5] fontconfig-2.16.2/redhat-linux-build/../fc-match/fc-match.c:151:49: warning[-Wanalyzer-malloc-leak]: leak of ‘format’ fontconfig-2.16.2/redhat-linux-build/../fc-match/fc-match.c:132:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-match/fc-match.c:137:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-match/fc-match.c:151:49: acquire_memory: allocated here fontconfig-2.16.2/redhat-linux-build/../fc-match/fc-match.c:132:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-match/fc-match.c:137:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-match/fc-match.c:151:49: danger: ‘format’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 149| break; # 150| case 'f': # 151|-> format = format_optarg = (FcChar8 *)strdup (optarg); # 152| break; # 153| case 'V': Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] fontconfig-2.16.2/redhat-linux-build/../fc-query/fc-query.c:138:33: warning[-Wanalyzer-malloc-leak]: leak of ‘format’ fontconfig-2.16.2/redhat-linux-build/../fc-query/fc-query.c:125:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-query/fc-query.c:130:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-query/fc-query.c:138:33: acquire_memory: allocated here fontconfig-2.16.2/redhat-linux-build/../fc-query/fc-query.c:125:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-query/fc-query.c:130:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-query/fc-query.c:138:33: danger: ‘format’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 136| break; # 137| case 'f': # 138|-> format = (FcChar8 *)strdup (optarg); # 139| break; # 140| case 'V': Error: GCC_ANALYZER_WARNING (CWE-401): [#def7] fontconfig-2.16.2/redhat-linux-build/../fc-scan/fc-scan.c:133:33: warning[-Wanalyzer-malloc-leak]: leak of ‘format’ fontconfig-2.16.2/redhat-linux-build/../fc-scan/fc-scan.c:123:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-scan/fc-scan.c:128:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-scan/fc-scan.c:133:33: acquire_memory: allocated here fontconfig-2.16.2/redhat-linux-build/../fc-scan/fc-scan.c:123:12: branch_true: following ‘true’ branch (when ‘c != -1’)... fontconfig-2.16.2/redhat-linux-build/../fc-scan/fc-scan.c:128:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../fc-scan/fc-scan.c:133:33: danger: ‘format’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 131| break; # 132| case 'f': # 133|-> format = (FcChar8 *)strdup (optarg); # 134| break; # 135| case 'y': Error: GCC_ANALYZER_WARNING (CWE-688): [#def8] fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:185:50: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dir’ where non-null expected fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1538:1: enter_function: entry to ‘FcDirCacheLock’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1548:5: call_function: calling ‘FcDirCacheBasenameMD5’ from ‘FcDirCacheLock’ #argument 1 of ‘__builtin_strlen’ must be non-null # 183| } # 184| MD5Init (&ctx); # 185|-> MD5Update (&ctx, (const unsigned char *)dir, strlen ((const char *)dir)); # 186| # 187| MD5Final (hash, &ctx); Error: GCC_ANALYZER_WARNING (CWE-457): [#def9] fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:238:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(char *)cache_base’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1148:1: enter_function: entry to ‘IA__FcDirCacheValid’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1154:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1157:11: call_function: inlined call to ‘FcDirCacheValidConfig’ from ‘IA__FcDirCacheValid’ #argument 1 of ‘__builtin_strlen’ must be a pointer to a null-terminated string # 236| cache_base[0] = '/'; # 237| strcpy ((char *)&cache_base[1], suuid); # 238|-> strcat ((char *)cache_base, "-" FC_ARCHITECTURE FC_CACHE_SUFFIX); # 239| if (FcDebug() & FC_DBG_CACHE) { # 240| printf ("cache fallbacks to: %s (dir: %s)\n", cache_base, dir); Error: GCC_ANALYZER_WARNING (CWE-401): [#def10] fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:562:16: warning[-Wanalyzer-malloc-leak]: leak of ‘s’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1167:1: enter_function: entry to ‘FcDirCacheBuild’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1176:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1181:5: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1185:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1190:40: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1198:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1202:21: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1203:8: branch_false: following ‘false’ branch (when ‘cache’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1206:5: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1220:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1222:18: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1228:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1230:19: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1243:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1245:18: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1249:5: call_function: calling ‘FcCacheInsert’ from ‘FcDirCacheBuild’ # 560| if (!s) { # 561| unlock_cache(); # 562|-> return FcFalse; # 563| } # 564| Error: GCC_ANALYZER_WARNING (CWE-688): [#def11] fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1510:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘s’ where non-null expected fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1438:1: enter_function: entry to ‘IA__FcDirCacheClean’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1451:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1454:15: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1459:8: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1464:9: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1464:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1470:8: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1473:8: branch_false: following ‘false’ branch... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1478:12: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1482:13: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1478:12: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1482:13: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1491:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1497:17: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1497:17: call_function: calling ‘IA__FcDirCacheLoadFile’ from ‘IA__FcDirCacheClean’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1497:17: return_function: returning to ‘IA__FcDirCacheClean’ from ‘IA__FcDirCacheLoadFile’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1498:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1505:26: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1506:16: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1509:21: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1509:21: acquire_memory: this call could return NULL fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1510:17: danger: argument 1 (‘s’) from [(48)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/47) could be NULL where non-null expected # 1508| else # 1509| s = FcStrdup (target_dir); # 1510|-> if (stat ((char *)s, &target_stat) < 0) { # 1511| if (verbose || FcDebug() & FC_DBG_CACHE) # 1512| printf ("%s: %s: missing directory: %s \n", Error: GCC_ANALYZER_WARNING (CWE-476): [#def12] fontconfig-2.16.2/redhat-linux-build/../src/fccfg.c:1594:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fe’ fontconfig-2.16.2/redhat-linux-build/../src/fccfg.c:2209:1: enter_function: entry to ‘IA__FcConfigSubstitute’ fontconfig-2.16.2/redhat-linux-build/../src/fccfg.c:2213:12: call_function: inlined call to ‘IA__FcConfigSubstituteWithPat’ from ‘IA__FcConfigSubstitute’ # 1592| if (!FcHashTableFind (table->family_hash, (const void *)s, (void **)&fe)) { # 1593| fe = malloc (sizeof (FamilyTableEntry)); # 1594|-> fe->count = 0; # 1595| FcHashTableAdd (table->family_hash, (void *)s, fe); # 1596| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def13] fontconfig-2.16.2/redhat-linux-build/../src/fccfg.c:1601:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fe’ fontconfig-2.16.2/redhat-linux-build/../src/fccfg.c:2209:1: enter_function: entry to ‘IA__FcConfigSubstitute’ fontconfig-2.16.2/redhat-linux-build/../src/fccfg.c:2213:12: call_function: inlined call to ‘IA__FcConfigSubstituteWithPat’ from ‘IA__FcConfigSubstitute’ # 1599| if (!FcHashTableFind (table->family_blank_hash, (const void *)s, (void **)&fe)) { # 1600| fe = malloc (sizeof (FamilyTableEntry)); # 1601|-> fe->count = 0; # 1602| FcHashTableAdd (table->family_blank_hash, (void *)s, fe); # 1603| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def14] fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:187:20: warning[-Wanalyzer-malloc-leak]: leak of ‘numbers’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1134:1: enter_function: entry to ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: call_function: calling ‘IA__FcCharSetCreate’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: return_function: returning to ‘FcCharSetFreeze’ from ‘IA__FcCharSetCreate’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1142:8: branch_false: following ‘false’ branch... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:17: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:43: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: call_function: calling ‘FcCharSetFreezeLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetFreezeLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1146:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:60: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: call_function: calling ‘FcCharSetInsertLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetInsertLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:31: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:17: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:43: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: call_function: calling ‘FcCharSetFreezeLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetFreezeLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1146:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:60: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: call_function: calling ‘FcCharSetInsertLeaf’ from ‘FcCharSetFreeze’ # 185| numbers = realloc (numbers, (alloced / 2) * sizeof (*numbers)); # 186| /* unlikely to fail though */ # 187|-> if (!numbers) # 188| return FcFalse; # 189| fcs->numbers_offset = FcPtrToOffset (fcs, numbers); Error: GCC_ANALYZER_WARNING (CWE-401): [#def15] fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:189:17: warning[-Wanalyzer-malloc-leak]: leak of ‘numbers’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1134:1: enter_function: entry to ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: call_function: calling ‘IA__FcCharSetCreate’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: return_function: returning to ‘FcCharSetFreeze’ from ‘IA__FcCharSetCreate’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1142:8: branch_false: following ‘false’ branch... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:17: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:43: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: call_function: calling ‘FcCharSetFreezeLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetFreezeLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1146:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:60: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: call_function: calling ‘FcCharSetInsertLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetInsertLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:31: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:17: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:43: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: call_function: calling ‘FcCharSetFreezeLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetFreezeLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1146:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:60: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: call_function: calling ‘FcCharSetInsertLeaf’ from ‘FcCharSetFreeze’ # 187| if (!numbers) # 188| return FcFalse; # 189|-> fcs->numbers_offset = FcPtrToOffset (fcs, numbers); # 190| return FcFalse; # 191| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def16] fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:209:5: warning[-Wanalyzer-malloc-leak]: leak of ‘leaves’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1134:1: enter_function: entry to ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: call_function: calling ‘IA__FcCharSetCreate’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: return_function: returning to ‘FcCharSetFreeze’ from ‘IA__FcCharSetCreate’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1142:8: branch_false: following ‘false’ branch... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:17: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:43: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: call_function: calling ‘FcCharSetFreezeLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetFreezeLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1146:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:60: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: call_function: calling ‘FcCharSetInsertLeaf’ from ‘FcCharSetFreeze’ # 207| numbers[pos] = (FcChar16)ucs4; # 208| leaves[pos] = FcPtrToOffset (leaves, leaf); # 209|-> fcs->num++; # 210| return FcTrue; # 211| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:209:5: warning[-Wanalyzer-malloc-leak]: leak of ‘numbers’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1134:1: enter_function: entry to ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: call_function: calling ‘IA__FcCharSetCreate’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1141:9: return_function: returning to ‘FcCharSetFreeze’ from ‘IA__FcCharSetCreate’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1142:8: branch_false: following ‘false’ branch... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1144:17: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:43: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: call_function: calling ‘FcCharSetFreezeLeaf’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1145:13: return_function: returning to ‘FcCharSetFreeze’ from ‘FcCharSetFreezeLeaf’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1146:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:60: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1148:14: call_function: calling ‘FcCharSetInsertLeaf’ from ‘FcCharSetFreeze’ # 207| numbers[pos] = (FcChar16)ucs4; # 208| leaves[pos] = FcPtrToOffset (leaves, leaf); # 209|-> fcs->num++; # 210| return FcTrue; # 211| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def18] fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1229:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cs’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1211:1: enter_function: entry to ‘FcCharSetSerializeAlloc’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1217:8: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1218:14: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1218:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1223:13: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1223:13: call_function: inlined call to ‘FcCharSetFindFrozen’ from ‘FcCharSetSerializeAlloc’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1223:12: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1223:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1226:14: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1226:14: call_function: calling ‘FcCharSetFreeze’ from ‘FcCharSetSerializeAlloc’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1226:14: return_function: returning to ‘FcCharSetSerializeAlloc’ from ‘FcCharSetFreeze’ fontconfig-2.16.2/redhat-linux-build/../src/fccharset.c:1229:14: danger: dereference of NULL ‘cs’ # 1227| } # 1228| # 1229|-> leaves = FcCharSetLeaves (cs); # 1230| numbers = FcCharSetNumbers (cs); # 1231| Error: GCC_ANALYZER_WARNING (CWE-476): [#def19] fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:1359:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘foundry_’ fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2115:1: enter_function: entry to ‘IA__FcFreeTypeQueryFace’ fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2120:12: call_function: calling ‘FcFreeTypeQueryFaceInternal’ from ‘IA__FcFreeTypeQueryFace’ # 1357| if (os2->achVendID[0] != 0) { # 1358| foundry_ = (FcChar8 *)malloc (sizeof (os2->achVendID) + 1); # 1359|-> memcpy ((void *)foundry_, os2->achVendID, sizeof (os2->achVendID)); # 1360| foundry_[sizeof (os2->achVendID)] = 0; # 1361| foundry = foundry_; Error: GCC_ANALYZER_WARNING (CWE-688): [#def20] fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:1397:9: warning[-Wanalyzer-null-argument]: use of NULL ‘name_mapping’ where non-null expected fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2151:1: enter_function: entry to ‘IA__FcFreeTypeQueryAll’ fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2176:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2179:9: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2179:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2182:21: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2184:8: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2186:12: branch_true: following ‘true’ branch... branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2218:15: call_function: calling ‘FcFreeTypeQueryFaceInternal’ from ‘IA__FcFreeTypeQueryAll’ # 1395| } # 1396| } # 1397|-> qsort (name_mapping, name_count, sizeof (FcNameMapping), name_mapping_cmp); # 1398| # 1399| if (nm_share) Error: GCC_ANALYZER_WARNING (CWE-476): [#def21] fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2199:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mm_var’ fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2162:20: release_memory: ‘mm_var’ is NULL fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2176:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2179:9: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2179:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2182:21: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2184:8: branch_false: following ‘false’ branch (when ‘num_instances == 0’)... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2190:8: branch_false: following ‘false’ branch (when ‘count’ is NULL)... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2196:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2198:17: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2198:17: branch_true: following ‘true’ branch (when ‘instance_num != 0’)... fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2199:51: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2199:51: release_memory: ‘mm_var’ is NULL fontconfig-2.16.2/redhat-linux-build/../src/fcfreetype.c:2199:45: danger: dereference of NULL ‘mm_var’ # 2197| FT_Set_Var_Design_Coordinates (face, 0, NULL); /* Reset variations. */ # 2198| else if (instance_num) { # 2199|-> FT_Var_Named_Style *instance = &mm_var->namedstyle[instance_num - 1]; # 2200| FT_Fixed *coords = instance->coords; # 2201| FcBool nonzero; Error: GCC_ANALYZER_WARNING (CWE-476): [#def22] fontconfig-2.16.2/redhat-linux-build/../src/fcinit.c:77:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘config’ fontconfig-2.16.2/redhat-linux-build/../src/fcinit.c:227:1: enter_function: entry to ‘IA__FcInitReinitialize’ fontconfig-2.16.2/redhat-linux-build/../src/fcinit.c:232:14: call_function: inlined call to ‘IA__FcInitLoadConfigAndFonts’ from ‘IA__FcInitReinitialize’ # 75| # 76| /* Copy filter data */ # 77|-> fallback->filter_func = config->filter_func; # 78| fallback->filter_data = config->filter_data; # 79| fallback->destroy_data_func = config->destroy_data_func; Error: GCC_ANALYZER_WARNING (CWE-476): [#def23] fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:77:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ls’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1021:1: enter_function: entry to ‘IA__FcLangSetUnion’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1023:12: call_function: calling ‘FcLangSetOperate’ from ‘IA__FcLangSetUnion’ # 75| id = fcLangCharSetIndices[id]; # 76| bucket = id >> 5; # 77|-> if (bucket >= ls->map_size) # 78| return; /* shouldn't happen really */ # 79| Error: GCC_ANALYZER_WARNING (CWE-476): [#def24] fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:105:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ls’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1027:1: enter_function: entry to ‘IA__FcLangSetSubtract’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1029:12: call_function: calling ‘FcLangSetOperate’ from ‘IA__FcLangSetSubtract’ # 103| id = fcLangCharSetIndices[id]; # 104| bucket = id >> 5; # 105|-> if (bucket >= ls->map_size) # 106| return; /* shouldn't happen really */ # 107| Error: GCC_ANALYZER_WARNING (CWE-457): [#def25] fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:556:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘lang[2]’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:756:1: enter_function: entry to ‘FcNameParseLangSet’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:762:10: call_function: calling ‘IA__FcLangSetCreate’ from ‘FcNameParseLangSet’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:762:10: return_function: returning to ‘FcNameParseLangSet’ from ‘IA__FcLangSetCreate’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:763:8: branch_false: following ‘false’ branch... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:767:21: branch_true: following ‘true’ branch (when ‘i != 31’)... fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:768:18: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:769:16: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:773:9: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:774:14: call_function: calling ‘IA__FcLangSetAdd’ from ‘FcNameParseLangSet’ # 554| if (cmp == 0 && # 555| (fcLangCharSets[mid].lang[2] != '\0' || # 556|-> lang[2] != '\0')) { # 557| cmp = FcStrCmpIgnoreCase (fcLangCharSets[mid].lang + 2, # 558| lang + 2); Error: GCC_ANALYZER_WARNING (CWE-476): [#def26] fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:583:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ls’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1021:1: enter_function: entry to ‘IA__FcLangSetUnion’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1023:12: call_function: calling ‘FcLangSetOperate’ from ‘IA__FcLangSetUnion’ # 581| return FcTrue; # 582| } # 583|-> if (!ls->extra) { # 584| ls->extra = FcStrSetCreate(); # 585| if (!ls->extra) Error: GCC_ANALYZER_WARNING (CWE-476): [#def27] fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:599:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ls’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1027:1: enter_function: entry to ‘IA__FcLangSetSubtract’ fontconfig-2.16.2/redhat-linux-build/../src/fclang.c:1029:12: call_function: calling ‘FcLangSetOperate’ from ‘IA__FcLangSetSubtract’ # 597| if (id >= 0) { # 598| FcLangSetBitReset (ls, id); # 599|-> } else if (ls->extra) { # 600| FcStrSetDel (ls->extra, lang); # 601| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def28] fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:520:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘e’ fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:986:1: enter_function: entry to ‘IA__FcFontMatch’ fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:994:5: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:995:5: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:995:5: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:997:5: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:1000:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:1003:9: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcmatch.c:1008:12: call_function: calling ‘FcFontSetMatchInternal’ from ‘IA__FcFontMatch’ # 518| if (!FcHashTableFind (table, key, (void **)&e)) { # 519| e = malloc (sizeof (FamilyEntry)); # 520|-> e->strong_value = 1e99; # 521| e->weak_value = 1e99; # 522| FcHashTableAdd (table, (void *)key, e); Error: GCC_ANALYZER_WARNING (CWE-688): [#def29] fontconfig-2.16.2/redhat-linux-build/../src/fcmutex.h:144:52: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘lock’ where non-null expected fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1042:1: enter_function: entry to ‘IA__FcDirCacheLoadFile’ fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1052:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1054:10: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1055:8: branch_true: following ‘true’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1056:17: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fccache.c:1056:17: call_function: calling ‘FcDirCacheMapFd’ from ‘IA__FcDirCacheLoadFile’ # 142| #define FC_MUTEX_INIT { FC_MUTEX_IMPL_INIT } # 143| typedef fc_mutex_impl_t FcMutex; # 144|-> static inline void FcMutexInit (FcMutex *m) { fc_mutex_impl_init (m); } # 145| static inline void FcMutexLock (FcMutex *m) { fc_mutex_impl_lock (m); } # 146| static inline void FcMutexUnlock (FcMutex *m) { fc_mutex_impl_unlock (m); } Error: GCC_ANALYZER_WARNING (CWE-401): [#def30] fontconfig-2.16.2/redhat-linux-build/../src/fcpat.c:531:12: warning[-Wanalyzer-malloc-leak]: leak of ‘e’ fontconfig-2.16.2/redhat-linux-build/../src/fcpat.c:1180:1: enter_function: entry to ‘IA__FcPatternVaBuild’ fontconfig-2.16.2/redhat-linux-build/../src/fcpat.c:1184:5: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcpat.c:1184:5: branch_false: following ‘false’ branch (when ‘__o__’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcpat.c:1184:5: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcpat.c:1184:5: call_function: calling ‘IA__FcPatternAdd’ from ‘IA__FcPatternVaBuild’ # 529| } # 530| # 531|-> return FcPatternElts (p) + i; # 532| } # 533| Error: GCC_ANALYZER_WARNING (CWE-457): [#def31] fontconfig-2.16.2/redhat-linux-build/../src/fcserialize.c:143:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*bucket.hash’ fontconfig-2.16.2/redhat-linux-build/../src/fcserialize.c:220:1: enter_function: entry to ‘FcSerializeAlloc’ fontconfig-2.16.2/redhat-linux-build/../src/fcserialize.c:223:8: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcserialize.c:226:10: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcserialize.c:226:10: call_function: calling ‘FcSerializeSet’ from ‘FcSerializeAlloc’ # 141| for (size_t n = 0; n < buckets_count; ++n) { # 142| FcSerializeBucket *bucket = &serialize->buckets[index]; # 143|-> if (bucket->hash == 0) { # 144| *bucket = *insert; # 145| ++serialize->buckets_used; Error: GCC_ANALYZER_WARNING (CWE-688): [#def32] fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1083:12: warning[-Wanalyzer-null-argument]: use of NULL ‘s’ where non-null expected fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1398:1: enter_function: entry to ‘FcStrSetAddFilenamePairWithSalt’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1404:8: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: call_function: calling ‘IA__FcStrCopyFilename’ from ‘FcStrSetAddFilenamePairWithSalt’ #argument 1 of ‘__builtin_strlen’ must be non-null # 1081| int size; # 1082| # 1083|-> size = strlen ((char *)s) + 1; # 1084| file = malloc (size); # 1085| if (!file) Error: GCC_ANALYZER_WARNING (CWE-457): [#def33] fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1083:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(char *)s’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1398:1: enter_function: entry to ‘FcStrSetAddFilenamePairWithSalt’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1404:8: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: call_function: calling ‘IA__FcStrCopyFilename’ from ‘FcStrSetAddFilenamePairWithSalt’ # 1081| int size; # 1082| # 1083|-> size = strlen ((char *)s) + 1; # 1084| file = malloc (size); # 1085| if (!file) Error: GCC_ANALYZER_WARNING (CWE-127): [#def34] fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1109:33: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1398:1: enter_function: entry to ‘FcStrSetAddFilenamePairWithSalt’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1404:8: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: call_function: calling ‘IA__FcStrCopyFilename’ from ‘FcStrSetAddFilenamePairWithSalt’ # 1107| f -= 3; /* trim /.. from file */ # 1108| while (f > file) { # 1109|-> if (*--f == '/') # 1110| break; # 1111| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def35] fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1556:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘list’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1398:1: enter_function: entry to ‘FcStrSetAddFilenamePairWithSalt’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1404:8: branch_true: following ‘true’ branch (when ‘a’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: branch_true: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1405:17: call_function: calling ‘IA__FcStrCopyFilename’ from ‘FcStrSetAddFilenamePairWithSalt’ # 1554| FcStrListNext (FcStrList *list) # 1555| { # 1556|-> if (list->n >= list->set->num) # 1557| return 0; # 1558| return list->set->strs[list->n++]; Error: GCC_ANALYZER_WARNING (CWE-457): [#def36] fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:1556:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*list.n’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:981:1: enter_function: entry to ‘IA__FcStrCopyFilename’ fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:989:12: branch_false: following ‘false’ branch... fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:991:16: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:993:12: branch_false: following ‘false’ branch (when ‘full’ is non-NULL)... fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:995:9: branch_false: ...to here fontconfig-2.16.2/redhat-linux-build/../src/fcstr.c:997:16: call_function: calling ‘FcStrCanonFilename’ from ‘IA__FcStrCopyFilename’ # 1554| FcStrListNext (FcStrList *list) # 1555| { # 1556|-> if (list->n >= list->set->num) # 1557| return 0; # 1558| return list->set->strs[list->n++]; Error: CPPCHECK_WARNING (CWE-476): [#def37] fontconfig-2.16.2/src/fccfg.c:1594: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fe # 1592| if (!FcHashTableFind (table->family_hash, (const void *)s, (void **)&fe)) { # 1593| fe = malloc (sizeof (FamilyTableEntry)); # 1594|-> fe->count = 0; # 1595| FcHashTableAdd (table->family_hash, (void *)s, fe); # 1596| } Error: CPPCHECK_WARNING (CWE-476): [#def38] fontconfig-2.16.2/src/fccfg.c:1597: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fe # 1595| FcHashTableAdd (table->family_hash, (void *)s, fe); # 1596| } # 1597|-> fe->count++; # 1598| # 1599| if (!FcHashTableFind (table->family_blank_hash, (const void *)s, (void **)&fe)) { Error: CPPCHECK_WARNING (CWE-476): [#def39] fontconfig-2.16.2/src/fccfg.c:1601: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fe # 1599| if (!FcHashTableFind (table->family_blank_hash, (const void *)s, (void **)&fe)) { # 1600| fe = malloc (sizeof (FamilyTableEntry)); # 1601|-> fe->count = 0; # 1602| FcHashTableAdd (table->family_blank_hash, (void *)s, fe); # 1603| } Error: CPPCHECK_WARNING (CWE-476): [#def40] fontconfig-2.16.2/src/fccfg.c:1604: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fe # 1602| FcHashTableAdd (table->family_blank_hash, (void *)s, fe); # 1603| } # 1604|-> fe->count++; # 1605| } # 1606| } Error: CPPCHECK_WARNING (CWE-401): [#def41] fontconfig-2.16.2/src/fccharset.c:175: error[memleakOnRealloc]: Common realloc mistake: 'numbers' nulled but not freed upon failure # 173| # 174| alloced *= 2; # 175|-> numbers = realloc (numbers, alloced * sizeof (*numbers)); # 176| if (!numbers) # 177| return FcFalse; Error: CPPCHECK_WARNING (CWE-401): [#def42] fontconfig-2.16.2/src/fccharset.c:185: error[memleakOnRealloc]: Common realloc mistake: 'numbers' nulled but not freed upon failure # 183| */ # 184| fcs->numbers_offset = FcPtrToOffset (fcs, numbers); # 185|-> numbers = realloc (numbers, (alloced / 2) * sizeof (*numbers)); # 186| /* unlikely to fail though */ # 187| if (!numbers) Error: COMPILER_WARNING: [#def43] fontconfig-2.16.2/src/fccharset.c: scope_hint: In function ‘FcCharSetPutLeaf’ fontconfig-2.16.2/src/fccharset.c:192:22: warning[-Wuse-after-free]: pointer ‘leaves_96’ may be used after ‘realloc’ # 192 | distance = (char *)new_leaves - (char *)leaves; # | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fontconfig-2.16.2/src/fccharset.c:178:26: note: call to ‘realloc’ here # 178 | new_leaves = realloc (leaves, alloced * sizeof (*leaves)); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 190| return FcFalse; # 191| } # 192|-> distance = (char *)new_leaves - (char *)leaves; # 193| for (i = 0; i < fcs->num; i++) { # 194| new_leaves[i] -= distance; Error: CPPCHECK_WARNING (CWE-476): [#def44] fontconfig-2.16.2/src/fcdir.c:101: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: s # 99| FcChar8 *s = FcStrdup (f); # 100| FcPatternObjectDel (font, FC_FILE_OBJECT); # 101|-> if (s[len] != '/') # 102| len--; # 103| else if (s[len + 1] == '/') Error: CPPCHECK_WARNING (CWE-476): [#def45] fontconfig-2.16.2/src/fcmatch.c:520: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e # 518| if (!FcHashTableFind (table, key, (void **)&e)) { # 519| e = malloc (sizeof (FamilyEntry)); # 520|-> e->strong_value = 1e99; # 521| e->weak_value = 1e99; # 522| FcHashTableAdd (table, (void *)key, e); Error: CPPCHECK_WARNING (CWE-476): [#def46] fontconfig-2.16.2/src/fcmatch.c:521: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: e # 519| e = malloc (sizeof (FamilyEntry)); # 520| e->strong_value = 1e99; # 521|-> e->weak_value = 1e99; # 522| FcHashTableAdd (table, (void *)key, e); # 523| } Error: COMPILER_WARNING (CWE-252): [#def47] fontconfig-2.16.2/src/fcxml.c: scope_hint: In function ‘_FcConfigParse’ fontconfig-2.16.2/src/fcxml.c:3414:13: warning[-Wunused-result]: ignoring return value of ‘strerror_r’ declared with attribute ‘warn_unused_result’ # 3414 | strerror_r (errno_, ebuf, BUFSIZ); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 3412| # 3413| #if HAVE_STRERROR_R # 3414|-> strerror_r (errno_, ebuf, BUFSIZ); # 3415| #elif HAVE_STRERROR # 3416| char *tmp = strerror (errno_); Error: CPPCHECK_WARNING (CWE-682): [#def48] fontconfig-2.16.2/src/ftglue.c:117: error[nullPointerArithmetic]: Pointer addition with NULL pointer. # 115| } # 116| stream->cursor = stream->base; # 117|-> stream->limit = stream->cursor + count; # 118| stream->pos += read_bytes; # 119| } else { Error: COMPILER_WARNING (CWE-252): [#def49] fontconfig-2.16.2/test/test-bz106632.c: scope_hint: In function ‘main’ fontconfig-2.16.2/test/test-bz106632.c:189:11: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ # 189 | (void)system (cmd); # | ^~~~~~~~~~~~ # 187| fprintf (stderr, "D: Copying %s to %s\n", FONTFILE, fontdir); # 188| snprintf (cmd, 512, "sleep 1; cp -a %s %s; sleep 1", FONTFILE, fontdir); # 189|-> (void)system (cmd); # 190| # 191| fprintf (stderr, "D: Loading a config\n"); Error: COMPILER_WARNING (CWE-252): [#def50] fontconfig-2.16.2/test/test-bz106632.c:216:11: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ # 216 | (void)system (cmd); # | ^~~~~~~~~~~~ # 214| fprintf (stderr, "D: Removing %s\n", fontdir); # 215| snprintf (cmd, 512, "sleep 1; rm -f %s%s*; sleep 1", fontdir, FC_DIR_SEPARATOR_S); # 216|-> (void)system (cmd); # 217| fprintf (stderr, "D: Reinitializing\n"); # 218| if (FcConfigUptoDate (config)) { Error: COMPILER_WARNING (CWE-252): [#def51] fontconfig-2.16.2/test/test-bz106632.c:258:11: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ # 258 | (void)system (cmd); # | ^~~~~~~~~~~~ # 256| fprintf (stderr, "D: Copying %s to %s\n", FONTFILE, fontdir); # 257| snprintf (cmd, 512, "sleep 1; cp -a %s %s; sleep 1", FONTFILE, fontdir); # 258|-> (void)system (cmd); # 259| fprintf (stderr, "D: Reinitializing\n"); # 260| if (FcConfigUptoDate (config)) {
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-11.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 | fontconfig-2.16.2-1.fc43 |
store-results-to | /tmp/tmp7obwatun/fontconfig-2.16.2-1.fc43.tar.xz |
time-created | 2025-04-25 12:31:03 |
time-finished | 2025-04-25 12:33:47 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp7obwatun/fontconfig-2.16.2-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp7obwatun/fontconfig-2.16.2-1.fc43.src.rpm' |
tool-version | csmock-3.8.1.20250422.172604.g26bc3d6-1.el9 |