fontconfig-2.15.0-6.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-cache/fc-cache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-cat/fc-cat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def3]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-list/fc-list.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def4]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-list/fc-list.c:126:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'format'
#  124|       setlocale (LC_ALL, "");
#  125|   #if HAVE_GETOPT_LONG
#  126|->     while ((c = getopt_long (argc, argv, "vbf:qVh", longopts, NULL)) != -1)
#  127|   #else
#  128|       while ((c = getopt (argc, argv, "vbf:qVh")) != -1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-list/fc-list.c: scope_hint: In function ‘main’
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-list/fc-list.c:139:34: warning[-Wanalyzer-malloc-leak]: leak of ‘format’
#  137|   	    break;
#  138|   	case 'f':
#  139|-> 	    format = (FcChar8 *) strdup (optarg);
#  140|   	    break;
#  141|   	case 'q':

Error: CPPCHECK_WARNING: [#def6]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-match/fc-match.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def7]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-match/fc-match.c:131:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'format'
#  129|       setlocale (LC_ALL, "");
#  130|   #if HAVE_GETOPT_LONG
#  131|->     while ((c = getopt_long (argc, argv, "asvbf:Vh", longopts, NULL)) != -1)
#  132|   #else
#  133|       while ((c = getopt (argc, argv, "asvbf:Vh")) != -1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-match/fc-match.c: scope_hint: In function ‘main’
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-match/fc-match.c:150:50: warning[-Wanalyzer-malloc-leak]: leak of ‘format’
#  148|   	    break;
#  149|   	case 'f':
#  150|-> 	    format = format_optarg = (FcChar8 *) strdup (optarg);
#  151|   	    break;
#  152|   	case 'V':

Error: CPPCHECK_WARNING: [#def9]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-pattern/fc-pattern.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def10]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-pattern/fc-pattern.c:120:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'format'
#  118|       setlocale (LC_ALL, "");
#  119|   #if HAVE_GETOPT_LONG
#  120|->     while ((c = getopt_long (argc, argv, "cdf:Vh", longopts, NULL)) != -1)
#  121|   #else
#  122|       while ((c = getopt (argc, argv, "cdf:Vh")) != -1)

Error: CPPCHECK_WARNING: [#def11]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-query/fc-query.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def12]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-query/fc-query.c:124:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'format'
#  122|       setlocale (LC_ALL, "");
#  123|   #if HAVE_GETOPT_LONG
#  124|->     while ((c = getopt_long (argc, argv, "i:bf:Vh", longopts, NULL)) != -1)
#  125|   #else
#  126|       while ((c = getopt (argc, argv, "i:bf:Vh")) != -1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-query/fc-query.c: scope_hint: In function ‘main’
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-query/fc-query.c:137:34: warning[-Wanalyzer-malloc-leak]: leak of ‘format’
#  135|   	    break;
#  136|   	case 'f':
#  137|-> 	    format = (FcChar8 *) strdup (optarg);
#  138|   	    break;
#  139|   	case 'V':

Error: CPPCHECK_WARNING: [#def14]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-scan/fc-scan.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def15]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-scan/fc-scan.c:122:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'format'
#  120|       setlocale (LC_ALL, "");
#  121|   #if HAVE_GETOPT_LONG
#  122|->     while ((c = getopt_long (argc, argv, "bf:y:Vh", longopts, NULL)) != -1)
#  123|   #else
#  124|       while ((c = getopt (argc, argv, "bf:y:Vh")) != -1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-scan/fc-scan.c: scope_hint: In function ‘main’
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-scan/fc-scan.c:132:34: warning[-Wanalyzer-malloc-leak]: leak of ‘format’
#  130|   	    break;
#  131|   	case 'f':
#  132|-> 	    format = (FcChar8 *) strdup (optarg);
#  133|   	    break;
#  134|   	case 'y':

Error: CPPCHECK_WARNING: [#def17]
fontconfig-2.15.0-build/fontconfig-2.15.0/fc-validate/fc-validate.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:50: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c: scope_hint: In function 'FcCacheInsert'
fontconfig-2.15.0-build/fontconfig-2.15.0/fontconfig/fontconfig.h:75:25: warning[-Wanalyzer-malloc-leak]: leak of 's'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:590:16: note: in expansion of macro 'FcFalse'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1292:18: note: in expansion of macro 'FcPtrToOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1300:19: note: in expansion of macro 'FcPtrToOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1316:18: note: in expansion of macro 'FcPtrToOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:590:16: note: in expansion of macro 'FcFalse'
#   73|   #define FC_CACHE_VERSION    	_FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
#   74|   
#   75|-> #define FcFalse		0
#   76|   #define FcTrue		1
#   77|   #define FcDontCare	2

Error: CPPCHECK_WARNING: [#def19]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcatomic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def20]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c: scope_hint: In function 'FcDirCacheBasenameMD5'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:182:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'key' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  180|   
#  181|   	key = (FcChar8 *) malloc (dl + sl + 1);
#  182|-> 	memcpy (key, dir, dl);
#  183|   	memcpy (key + dl, salt, sl + 1);
#  184|   	key[dl + sl] = 0;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def21]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c: scope_hint: In function 'FcDirCacheBasenameUUID'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:247:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*(char *)cache_base'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1218:1: note: in expansion of macro 'FcDirCacheValid'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c: scope_hint: In function 'FcDirCacheBasenameUUID'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:377:5: note: in expansion of macro 'FcStrFree'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:25: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:212:9: note: in expansion of macro 'FcStrFree'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:230:18: note: in expansion of macro 'FcStrBuildFilename'
<built-in>: note: argument 1 of '__builtin_strlen' must be a pointer to a null-terminated string
#  245|   	cache_base[0] = '/';
#  246|   	strcpy ((char *)&cache_base[1], suuid);
#  247|-> 	strcat ((char *) cache_base, "-" FC_ARCHITECTURE FC_CACHE_SUFFIX);
#  248|   	if (FcDebug () & FC_DBG_CACHE)
#  249|   	{

Error: CLANG_WARNING: [#def22]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:504:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'lock'
#  502|       FcMutexLock (lock);
#  503|       /* Initialize random state */
#  504|->     FcRandom ();
#  505|       return;
#  506|     }

Error: CLANG_WARNING: [#def23]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:620:15: warning[core.NullDereference]: Dereference of undefined pointer value
#  618|       for (i = 0; i < level; i++)
#  619|       {
#  620|-> 	s->next[i] = *update[i];
#  621|   	*update[i] = s;
#  622|       }

Error: CLANG_WARNING: [#def24]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:624:5: warning[unix.Malloc]: Potential leak of memory pointed to by 's'
#  622|       }
#  623|   
#  624|->     unlock_cache ();
#  625|       return FcTrue;
#  626|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def25]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c: scope_hint: In function 'IA__FcDirCacheClean'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1580:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 's' where non-null expected
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1500:1: note: in expansion of macro 'FcDirCacheClean'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1516:15: note: in expansion of macro 'FcConfigGetSysRoot'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1556:21: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1564:17: note: in expansion of macro 'FcDirCacheLoadFile'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1564:17: note: in expansion of macro 'FcDirCacheLoadFile'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1109:1: note: in expansion of macro 'FcDirCacheLoadFile'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:820:34: note: in expansion of macro 'FcConfigGetSysRoot'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1564:17: note: in expansion of macro 'FcDirCacheLoadFile'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:71: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:430:25: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1575:26: note: in expansion of macro 'FcCacheDir'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1579:21: note: in expansion of macro 'FcStrdup'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1579:21: note: in expansion of macro 'FcStrdup'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:48: included_from: Included from here.
/usr/include/sys/stat.h:205:12: note: argument 1 of 'stat' must be non-null
# 1578|   	    else
# 1579|   		s = FcStrdup (target_dir);
# 1580|-> 	    if (stat ((char *) s, &target_stat) < 0)
# 1581|   	    {
# 1582|   		if (verbose || FcDebug () & FC_DBG_CACHE)

Error: CLANG_WARNING: [#def26]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:62:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'lock'
#   60|   	FcMutexLock (lock);
#   61|   	/* Initialize random state */
#   62|-> 	FcRandom ();
#   63|   	return;
#   64|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def27]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c: scope_hint: In function 'FamilyTableAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1603:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'fe'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:2292:1: note: in expansion of macro 'FcConfigSubstitute'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:2296:12: note: in expansion of macro 'FcConfigSubstituteWithPat'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c: scope_hint: In function 'FamilyTableAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1954:1: note: in expansion of macro 'FcConfigSubstituteWithPat'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:152:48: note: in definition of macro 'FcIsEncodedOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:223:33: note: in expansion of macro 'FcPointerMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1666:32: note: in expansion of macro 'FcPatternEltValues'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:152:48: note: in definition of macro 'FcIsEncodedOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:188:33: note: in expansion of macro 'FcPointerMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1597:32: note: in expansion of macro 'FcValueString'
# 1601|               {
# 1602|                   fe = malloc (sizeof (FamilyTableEntry));
# 1603|->                 fe->count = 0;
# 1604|                   FcHashTableAdd (table->family_hash, (void *)s, fe);
# 1605|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def28]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1611:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'fe'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:2292:1: note: in expansion of macro 'FcConfigSubstitute'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:2296:12: note: in expansion of macro 'FcConfigSubstituteWithPat'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c: scope_hint: In function 'FamilyTableAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1954:1: note: in expansion of macro 'FcConfigSubstituteWithPat'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:152:48: note: in definition of macro 'FcIsEncodedOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:223:33: note: in expansion of macro 'FcPointerMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1666:32: note: in expansion of macro 'FcPatternEltValues'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:152:48: note: in definition of macro 'FcIsEncodedOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:188:33: note: in expansion of macro 'FcPointerMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:1597:32: note: in expansion of macro 'FcValueString'
# 1609|               {
# 1610|                   fe = malloc (sizeof (FamilyTableEntry));
# 1611|->                 fe->count = 0;
# 1612|                   FcHashTableAdd (table->family_blank_hash, (void *)s, fe);
# 1613|               }

Error: CLANG_WARNING: [#def29]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccfg.c:3030:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'config'
# 3028|   	s = FcStrRealPath (sysroot);
# 3029|   	if (!s)
# 3030|-> 	    return;
# 3031|       }
# 3032|   

Error: CPPCHECK_WARNING: [#def30]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-401): [#def31]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:184: error[memleakOnRealloc]: Common realloc mistake: 'numbers' nulled but not freed upon failure
#  182|   
#  183|   	alloced *= 2;
#  184|-> 	numbers = realloc (numbers, alloced * sizeof (*numbers));
#  185|   	if (!numbers)
#  186|   	    return FcFalse;

Error: CPPCHECK_WARNING (CWE-401): [#def32]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:195: error[memleakOnRealloc]: Common realloc mistake: 'numbers' nulled but not freed upon failure
#  193|   	     */
#  194|   	    fcs->numbers_offset = FcPtrToOffset (fcs, numbers);
#  195|-> 	    numbers = realloc (numbers, (alloced / 2) * sizeof (*numbers));
#  196|   	    /* unlikely to fail though */
#  197|   	    if (!numbers)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:197:16: warning[-Wanalyzer-malloc-leak]: leak of 'numbers'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:123: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:25: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:31:1: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:53: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:173:37: note: in expansion of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:375:48: note: in expansion of macro 'FcCharSetLeaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1232:43: note: in expansion of macro 'FcCharSetLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:53: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:173:37: note: in expansion of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:375:48: note: in expansion of macro 'FcCharSetLeaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1232:43: note: in expansion of macro 'FcCharSetLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:145:43: note: in definition of macro 'FC_IS_ZERO_OR_POWER_OF_TWO'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:194:35: note: in expansion of macro 'FcPtrToOffset'
#  195|   	    numbers = realloc (numbers, (alloced / 2) * sizeof (*numbers));
#  196|   	    /* unlikely to fail though */
#  197|-> 	    if (!numbers)
#  198|   		return FcFalse;
#  199|   	    fcs->numbers_offset = FcPtrToOffset (fcs, numbers);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:199:33: warning[-Wanalyzer-malloc-leak]: leak of 'numbers'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:31:1: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:53: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:173:37: note: in expansion of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:375:48: note: in expansion of macro 'FcCharSetLeaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1232:43: note: in expansion of macro 'FcCharSetLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:53: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:173:37: note: in expansion of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:375:48: note: in expansion of macro 'FcCharSetLeaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1232:43: note: in expansion of macro 'FcCharSetLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:145:43: note: in definition of macro 'FC_IS_ZERO_OR_POWER_OF_TWO'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:194:35: note: in expansion of macro 'FcPtrToOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:199:35: note: in expansion of macro 'FcPtrToOffset'
#  197|   	    if (!numbers)
#  198|   		return FcFalse;
#  199|-> 	    fcs->numbers_offset = FcPtrToOffset (fcs, numbers);
#  200|   	    return FcFalse;
#  201|   	}

Error: COMPILER_WARNING: [#def35]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:202:18: warning[-Wuse-after-free]: pointer 'leaves_96' may be used after 'realloc'
#  202 |         distance = (char *) new_leaves - (char *) leaves;
#      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:187:22: note: call to 'realloc' here
#  187 |         new_leaves = realloc (leaves, alloced * sizeof (*leaves));
#      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  200|   	    return FcFalse;
#  201|   	}
#  202|-> 	distance = (char *) new_leaves - (char *) leaves;
#  203|   	for (i = 0; i < fcs->num; i++) {
#  204|   	    new_leaves[i] -= distance;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:219:13: warning[-Wanalyzer-malloc-leak]: leak of 'leaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:31:1: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:53: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:173:37: note: in expansion of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:375:48: note: in expansion of macro 'FcCharSetLeaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1232:43: note: in expansion of macro 'FcCharSetLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:145:43: note: in definition of macro 'FC_IS_ZERO_OR_POWER_OF_TWO'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:209:28: note: in expansion of macro 'FcPtrToOffset'
#  217|       numbers[pos] = (FcChar16) ucs4;
#  218|       leaves[pos] = FcPtrToOffset (leaves, leaf);
#  219|->     fcs->num++;
#  220|       return FcTrue;
#  221|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:219:13: warning[-Wanalyzer-malloc-leak]: leak of 'numbers'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:31:1: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:53: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:173:37: note: in expansion of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:375:48: note: in expansion of macro 'FcCharSetLeaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1232:43: note: in expansion of macro 'FcCharSetLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetPutLeaf'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:145:43: note: in definition of macro 'FC_IS_ZERO_OR_POWER_OF_TWO'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:209:28: note: in expansion of macro 'FcPtrToOffset'
#  217|       numbers[pos] = (FcChar16) ucs4;
#  218|       leaves[pos] = FcPtrToOffset (leaves, leaf);
#  219|->     fcs->num++;
#  220|       return FcTrue;
#  221|   }

Error: CLANG_WARNING: [#def38]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:579:38: warning[core.NullDereference]: Array access (via field 'map') results in a null pointer dereference
#  577|   
#  578|       for (i = 0; i < 256/32; i++)
#  579|-> 	if ((result->map[i] = al->map[i] & ~bl->map[i]))
#  580|   	    nonempty = FcTrue;
#  581|       return nonempty;

Error: CLANG_WARNING: [#def39]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:692:41: warning[core.NullDereference]: Dereference of null pointer
#  690|   		    FcChar32	*bm = bi.leaf->map;
#  691|   		    while (i--)
#  692|-> 			count += FcCharSetPopCount (*am++ & ~*bm++);
#  693|   		}
#  694|   		else

Error: CLANG_WARNING: [#def40]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcdefault.c:219:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'prgname'
#  217|   
#  218|       if (prgname && !prgname[0])
#  219|-> 	return NULL;
#  220|   
#  221|       return prgname;

Error: CLANG_WARNING: [#def41]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcdefault.c:254:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'desktop_name'
#  252|       }
#  253|       if (desktop_name && !desktop_name[0])
#  254|-> 	return NULL;
#  255|   
#  256|       return desktop_name;

Error: CPPCHECK_WARNING: [#def42]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcdir.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def43]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcformat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def44]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c: scope_hint: In function 'FcFreeTypeQueryFaceInternal'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:1422:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'foundry_'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcftint.h:31: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:26: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:2279:1: note: in expansion of macro 'FcFreeTypeQueryFace'
fontconfig-2.15.0-build/fontconfig-2.15.0/fontconfig/fcfreetype.h:28: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcftint.h:26: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:1272:23: note: in expansion of macro 'FT_HAS_COLOR'
# 1420|   	{
# 1421|   	    foundry_ = (FcChar8 *) malloc (sizeof (os2->achVendID) + 1);
# 1422|-> 	    memcpy ((void *)foundry_, os2->achVendID, sizeof (os2->achVendID));
# 1423|   	    foundry_[sizeof (os2->achVendID)] = 0;
# 1424|   	    foundry = foundry_;

Error: CLANG_WARNING: [#def46]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:1465:2: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1463|   	    }
# 1464|   	}
# 1465|-> 	qsort (name_mapping, name_count, sizeof(FcNameMapping), name_mapping_cmp);
# 1466|   
# 1467|   	if (nm_share)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def47]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:1465:9: warning[-Wanalyzer-null-argument]: use of NULL 'name_mapping' where non-null expected
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:123: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:25: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:2315:1: note: in expansion of macro 'FcFreeTypeQueryAll'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:1272:23: note: in expansion of macro 'FT_HAS_COLOR'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:34: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of 'qsort' must be non-null
# 1463|   	    }
# 1464|   	}
# 1465|-> 	qsort (name_mapping, name_count, sizeof(FcNameMapping), name_mapping_cmp);
# 1466|   
# 1467|   	if (nm_share)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c: scope_hint: In function 'IA__FcFreeTypeQueryAll'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:2365:51: warning[-Wanalyzer-null-dereference]: dereference of NULL 'mm_var'
# 2363|   	else if (instance_num)
# 2364|   	{
# 2365|-> 	    FT_Var_Named_Style *instance = &mm_var->namedstyle[instance_num - 1];
# 2366|   	    FT_Fixed *coords = instance->coords;
# 2367|   	    FcBool nonzero;

Error: CLANG_WARNING: [#def49]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:2646:23: warning[core.NullDereference]: Array access (via field 'map') results in a null pointer dereference
# 2644|   		}
# 2645|   		off = ucs4 & 0xff;
# 2646|-> 		leaf->map[off >> 5] |= (1U << (off & 0x1f));
# 2647|   	    }
# 2648|   

Error: CLANG_WARNING: [#def50]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:2763:11: warning[deadcode.DeadStores]: Although the value stored to 'error' is used in the enclosing expression, the value is never actually read from 'error'
# 2761|           return FcFalse;
# 2762|   
# 2763|->     if (( error = ftglue_face_goto_table( face, tabletag, stream ) ))
# 2764|   	return FcFalse;
# 2765|   

Error: CLANG_WARNING: [#def51]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:2781:11: warning[deadcode.DeadStores]: Although the value stored to 'error' is used in the enclosing expression, the value is never actually read from 'error'
# 2779|           return 0;
# 2780|   
# 2781|->     if (( error = ftglue_face_goto_table( face, tabletag, stream ) ))
# 2782|   	return 0;
# 2783|   

Error: CLANG_WARNING: [#def52]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcfreetype.c:2795:5: warning[deadcode.DeadStores]: Value stored to 'cur_offset' is never read
# 2793|       ftglue_stream_frame_exit( stream );
# 2794|   
# 2795|->     cur_offset = ftglue_stream_pos( stream );
# 2796|   
# 2797|       if ( ftglue_stream_seek( stream, new_offset ) != FT_Err_Ok )

Error: CLANG_WARNING: [#def53]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fchash.c:179:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'bucket'
#  177|   	goto retry;
#  178|   
#  179|->     return FcTrue;
#  180|   }
#  181|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetSerializeAlloc'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:173:56: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cs'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:71: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1324:14: note: in expansion of macro 'FcCharSetLeaves'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c: scope_hint: In function 'FcCharSetSerializeAlloc'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:31:1: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1227:9: note: in expansion of macro 'FcCharSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:164:71: note: in definition of macro 'FcOffsetToPtr'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:374:33: note: in expansion of macro 'FcOffsetMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccharset.c:1324:14: note: in expansion of macro 'FcCharSetLeaves'
#  171|   
#  172|   /* Given a structure, offset member and type, return pointer */
#  173|-> #define FcOffsetMember(s,m,t)	    FcOffsetToPtr(s,(s)->m,t)
#  174|   
#  175|   /* Given a structure, encoded offset member and type, return pointer to member */

Error: CPPCHECK_WARNING: [#def55]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def56]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c: scope_hint: In function 'FcLangSetBitSet'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:59:19: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ls'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:123: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:25: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1096:1: note: in expansion of macro 'FcLangSetUnion'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:497:1: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:603:1: note: in expansion of macro 'FcLangSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:50: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/fontconfig/fontconfig.h:1042:36: note: in definition of macro 'FcIsUpper'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:552:38: note: in expansion of macro 'FcToLower'
#   57|     id = fcLangCharSetIndices[id];
#   58|     bucket = id >> 5;
#   59|->   if (bucket >= ls->map_size)
#   60|       return; /* shouldn't happen really */
#   61|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def57]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c: scope_hint: In function 'FcLangSetBitReset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:87:19: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ls'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1102:1: note: in expansion of macro 'FcLangSetSubtract'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:497:1: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:623:1: note: in expansion of macro 'FcLangSetDel'
fontconfig-2.15.0-build/fontconfig-2.15.0/fontconfig/fontconfig.h:1042:36: note: in definition of macro 'FcIsUpper'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:552:38: note: in expansion of macro 'FcToLower'
#   85|     id = fcLangCharSetIndices[id];
#   86|     bucket = id >> 5;
#   87|->   if (bucket >= ls->map_size)
#   88|       return; /* shouldn't happen really */
#   89|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def58]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c: scope_hint: In function 'FcLangSetIndex'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:584:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'lang[2]'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:812:10: note: in expansion of macro 'FcLangSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:472:1: note: in expansion of macro 'FcLangSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:812:10: note: in expansion of macro 'FcLangSetCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:826:14: note: in expansion of macro 'FcLangSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:603:1: note: in expansion of macro 'FcLangSetAdd'
#  582|   	    if (cmp == 0 &&
#  583|   		(fcLangCharSets[mid].lang[2] != '\0' ||
#  584|-> 		 lang[2] != '\0'))
#  585|   	    {
#  586|   		cmp = FcStrCmpIgnoreCase(fcLangCharSets[mid].lang+2,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def59]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c: scope_hint: In function 'IA__FcLangSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:613:12: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ls'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1096:1: note: in expansion of macro 'FcLangSetUnion'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:497:1: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:603:1: note: in expansion of macro 'FcLangSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/fontconfig/fontconfig.h:1042:36: note: in definition of macro 'FcIsUpper'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:552:38: note: in expansion of macro 'FcToLower'
#  611|   	return FcTrue;
#  612|       }
#  613|->     if (!ls->extra)
#  614|       {
#  615|   	ls->extra = FcStrSetCreate ();

Error: GCC_ANALYZER_WARNING (CWE-476): [#def60]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c: scope_hint: In function 'IA__FcLangSetDel.part.0'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:632:16: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ls'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1102:1: note: in expansion of macro 'FcLangSetSubtract'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:497:1: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:1080:28: note: in expansion of macro 'FcLangSetCopy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:623:1: note: in expansion of macro 'FcLangSetDel'
fontconfig-2.15.0-build/fontconfig-2.15.0/fontconfig/fontconfig.h:1042:36: note: in definition of macro 'FcIsUpper'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:552:38: note: in expansion of macro 'FcToLower'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclang.c:623:1: note: in expansion of macro 'FcLangSetDel'
#  630|   	FcLangSetBitReset (ls, id);
#  631|       }
#  632|->     else if (ls->extra)
#  633|       {
#  634|   	FcStrSetDel (ls->extra, lang);

Error: CPPCHECK_WARNING: [#def61]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fclist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def62]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c: scope_hint: In function 'FcCompareDataInit'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:539:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'e'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:123: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:25: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:1062:1: note: in expansion of macro 'FcFontMatch'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:38: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:152:48: note: in definition of macro 'FcIsEncodedOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:223:33: note: in expansion of macro 'FcPointerMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:533:18: note: in expansion of macro 'FcPatternEltValues'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:223:33: note: in expansion of macro 'FcPointerMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:533:18: note: in expansion of macro 'FcPatternEltValues'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:152:48: note: in definition of macro 'FcIsEncodedOffset'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:188:33: note: in expansion of macro 'FcPointerMember'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:535:19: note: in expansion of macro 'FcValueString'
#  537|               {
#  538|                   e = malloc (sizeof (FamilyEntry));
#  539|->                 e->strong_value = 1e99;
#  540|                   e->weak_value = 1e99;
#  541|                   FcHashTableAdd (table, (void *)key, e);

Error: CLANG_WARNING: [#def64]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:785:6: warning[core.CallAndMessage]: Passed-by-value struct argument contains uninitialized data (e.g., field: 'type')
#  783|   		return NULL;
#  784|   	    }
#  785|-> 	    FcPatternObjectAdd (new, fe->object, v, FcFalse);
#  786|   
#  787|   	    /* Set font-variations settings for standard axes in variable fonts. */

Error: CPPCHECK_WARNING (CWE-909): [#def65]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmatch.c:799: error[uninitStructMember]: Uninitialized struct member: variations.len
#  797|   		assert (v.type == FcTypeDouble);
#  798|   		num = v.u.d;
#  799|-> 		if (variations.len)
#  800|   		    FcStrBufChar (&variations, ',');
#  801|   		switch (fe->object)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmutex.h:65:33: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'lock' where non-null expected
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmutex.h:121:49: note: in expansion of macro 'fc_mutex_impl_init'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:123: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c: scope_hint: In function 'lock_cache'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fccache.c:1109:1: note: in expansion of macro 'FcDirCacheLoadFile'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmutex.h:121:49: note: in expansion of macro 'fc_mutex_impl_init'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcmutex.h:62: included_from: Included from here.
/usr/include/pthread.h: scope_hint: In function 'lock_cache'
/usr/include/pthread.h:781:12: note: argument 1 of 'pthread_mutex_init' must be non-null
#   63|   typedef pthread_mutex_t fc_mutex_impl_t;
#   64|   #define FC_MUTEX_IMPL_INIT	PTHREAD_MUTEX_INITIALIZER
#   65|-> #define fc_mutex_impl_init(M)	pthread_mutex_init (M, NULL)
#   66|   #define fc_mutex_impl_lock(M)	pthread_mutex_lock (M)
#   67|   #define fc_mutex_impl_unlock(M)	pthread_mutex_unlock (M)

Error: CPPCHECK_WARNING: [#def67]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcname.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def68]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c: scope_hint: In function 'FcPatternObjectInsertElt'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:551:29: warning[-Wanalyzer-malloc-leak]: leak of 'e'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:1225:1: note: in expansion of macro 'FcPatternVaBuild'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:1229:5: note: in expansion of macro 'FcPatternVapBuild'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:1229:5: note: in expansion of macro 'FcPatternVapBuild'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:1229:5: note: in expansion of macro 'FcPatternVapBuild'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:1229:5: note: in expansion of macro 'FcPatternVapBuild'
fontconfig-2.15.0-build/fontconfig-2.15.0/fontconfig/fcprivate.h:84:14: note: in expansion of macro 'FcPatternAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:1229:5: note: in expansion of macro 'FcPatternVapBuild'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:743:1: note: in expansion of macro 'FcPatternAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c: scope_hint: In function 'FcPatternObjectInsertElt'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:691:18: note: in expansion of macro 'FcValueSave'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:691:18: note: in expansion of macro 'FcValueSave'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:99:1: note: in expansion of macro 'FcValueSave'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:691:18: note: in expansion of macro 'FcValueSave'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:510:13: note: in expansion of macro 'FcPatternObjectCount'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c: scope_hint: In function 'FcPatternObjectInsertElt'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcpat.c:528:30: note: in expansion of macro 'FcPtrToOffset'
#  549|       }
#  550|   
#  551|->     return FcPatternElts(p) + i;
#  552|   }
#  553|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def70]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcserialize.c: scope_hint: In function 'FcSerializeUncheckedSet'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcserialize.c:143:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*bucket.hash'
#  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: CLANG_WARNING: [#def71]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcserialize.c:143:19: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
#  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: CPPCHECK_WARNING: [#def72]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def73]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:778:40: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  776|   	if (len < 2)
#  777|   	    return 0;
#  778|-> 	b = GetUtf16 (src, endian); src += 2; len -= 2;
#  779|   	/*
#  780|   	 * Check for invalid surrogate sequence

Error: CLANG_WARNING: [#def74]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1015:5: warning[unix.Malloc]: Use of memory after it is freed
# 1013|       va_end (ap);
# 1014|   bail0:
# 1015|->     FcStrSetDestroy (sset);
# 1016|   
# 1017|       return ret;

Error: CLANG_WARNING: [#def75]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1017:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'sset'
# 1015|       FcStrSetDestroy (sset);
# 1016|   
# 1017|->     return ret;
# 1018|   }
# 1019|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def76]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'FcStrCanonAbsoluteFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1126:12: warning[-Wanalyzer-null-argument]: use of NULL 's' where non-null expected
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:123: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:25: included_from: Included from here.
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1021:1: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:959:1: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
<built-in>: note: argument 1 of '__builtin_strlen' must be non-null
# 1124|       int size;
# 1125|   
# 1126|->     size = strlen ((char *) s) + 1;
# 1127|       file = malloc (size);
# 1128|       if (!file)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def77]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1126:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*(char *)s'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1021:1: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:959:1: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'FcStrCanonAbsoluteFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1389:1: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1291:28: note: in expansion of macro 'FcStrSetHasControlBit'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1389:1: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1613:1: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcatomic.h:165:56: note: in expansion of macro 'fc_atomic_int_add'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'FcStrCanonAbsoluteFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:988:17: note: in expansion of macro 'FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1633:1: note: in expansion of macro 'FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:988:17: note: in expansion of macro 'FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1011:5: note: in expansion of macro 'FcStrListDone'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1641:1: note: in expansion of macro 'FcStrListDone'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1643:5: note: in expansion of macro 'FcStrSetDestroy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1591:1: note: in expansion of macro 'FcStrSetDestroy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'FcStrCanonAbsoluteFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcatomic.h:166:56: note: in expansion of macro 'fc_atomic_int_add'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'FcStrCanonAbsoluteFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1643:5: note: in expansion of macro 'FcStrSetDestroy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1011:5: note: in expansion of macro 'FcStrListDone'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1015:5: note: in expansion of macro 'FcStrSetDestroy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1591:1: note: in expansion of macro 'FcStrSetDestroy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'FcStrCanonAbsoluteFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcatomic.h:166:56: note: in expansion of macro 'fc_atomic_int_add'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'FcStrCanonAbsoluteFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1591:1: note: in expansion of macro 'FcStrSetDestroy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1015:5: note: in expansion of macro 'FcStrSetDestroy'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcint.h:36: included_from: Included from here.
/usr/include/string.h:407:15: note: argument 1 of 'strlen' must be a pointer to a null-terminated string
# 1124|       int size;
# 1125|   
# 1126|->     size = strlen ((char *) s) + 1;
# 1127|       file = malloc (size);
# 1128|       if (!file)

Error: GCC_ANALYZER_WARNING (CWE-127): [#def78]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1156:33: warning[-Wanalyzer-out-of-bounds]: heap-based buffer under-read
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1021:1: note: in expansion of macro 'FcStrCopyFilename'
#  └──────────────────────────┘
#               ^
# 1154|   			f -= 3;	/* trim /.. from file */
# 1155|   			while (f > file) {
# 1156|-> 			    if (*--f == '/')
# 1157|   				break;
# 1158|   			}

Error: CLANG_WARNING: [#def79]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1307:19: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
# 1305|   	set->strs[set->num] = 0;
# 1306|   	for (i = set->num - 1; i > pos; i--)
# 1307|-> 	    set->strs[i] = set->strs[i - 1];
# 1308|   	set->strs[pos] = s;
# 1309|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def80]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'IA__FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1635:13: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1474:17: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1021:1: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:959:1: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'IA__FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1389:1: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1291:28: note: in expansion of macro 'FcStrSetHasControlBit'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1389:1: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1613:1: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:988:17: note: in expansion of macro 'FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1633:1: note: in expansion of macro 'FcStrListNext'
# 1633|   FcStrListNext (FcStrList *list)
# 1634|   {
# 1635|->     if (list->n >= list->set->num)
# 1636|   	return 0;
# 1637|       return list->set->strs[list->n++];

Error: GCC_ANALYZER_WARNING (CWE-457): [#def81]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1635:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*list.n'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1021:1: note: in expansion of macro 'FcStrCopyFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1233:16: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:959:1: note: in expansion of macro 'FcStrBuildFilename'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c: scope_hint: In function 'IA__FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1389:1: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1291:28: note: in expansion of macro 'FcStrSetHasControlBit'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:975:10: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1389:1: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:984:14: note: in expansion of macro 'FcStrSetAdd'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1613:1: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:987:12: note: in expansion of macro 'FcStrListCreate'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:988:17: note: in expansion of macro 'FcStrListNext'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcstr.c:1633:1: note: in expansion of macro 'FcStrListNext'
# 1633|   FcStrListNext (FcStrList *list)
# 1634|   {
# 1635|->     if (list->n >= list->set->num)
# 1636|   	return 0;
# 1637|       return list->set->strs[list->n++];

Error: CLANG_WARNING: [#def82]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcxml.c:600:17: warning[deadcode.DeadStores]: Value stored to 's' during its initialization is never read
#  598|   FcConfigMessage (FcConfigParse *parse, FcConfigSeverity severe, const char *fmt, ...)
#  599|   {
#  600|->     const char	*s = "unknown";
#  601|       va_list	args;
#  602|   

Error: CLANG_WARNING: [#def83]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcxml.c:2082:6: warning[deadcode.DeadStores]: Value stored to 'r' is never read
# 2080|   	{
# 2081|   	    r->next = FcRuleCreate (FcRuleEdit, edit);
# 2082|-> 	    r = r->next;
# 2083|   	}
# 2084|       }

Error: CLANG_WARNING: [#def84]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcxml.c:2805:1: warning[unix.Malloc]: Potential leak of memory pointed to by 'test'
# 2803|       }
# 2804|       FcVStackPushTest (parse, test);
# 2805|-> }
# 2806|   
# 2807|   static const FcOpMap fcModeOps[] = {

Error: COMPILER_WARNING (CWE-252): [#def85]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcxml.c: scope_hint: In function '_FcConfigParse'
fontconfig-2.15.0-build/fontconfig-2.15.0/src/fcxml.c:3665:13: warning[-Wunused-result]: ignoring return value of 'strerror_r' declared with attribute 'warn_unused_result'
# 3665 |             strerror_r (errno_, ebuf, BUFSIZ);
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3663|   
# 3664|   #if HAVE_STRERROR_R
# 3665|-> 	    strerror_r (errno_, ebuf, BUFSIZ);
# 3666|   #elif HAVE_STRERROR
# 3667|   	    char *tmp = strerror (errno_);

Error: CPPCHECK_WARNING (CWE-682): [#def86]
fontconfig-2.15.0-build/fontconfig-2.15.0/src/ftglue.c:125: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
#  123|       }
#  124|       stream->cursor = stream->base;
#  125|->     stream->limit  = stream->cursor + count;
#  126|       stream->pos   += read_bytes;
#  127|     }

Error: CPPCHECK_WARNING: [#def87]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-bz106632.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING (CWE-252): [#def88]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-bz106632.c: scope_hint: In function ‘main’
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-bz106632.c:197:12: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#  197 |     (void) system (cmd);
#      |            ^~~~~~~~~~~~
#  195|       fprintf (stderr, "D: Copying %s to %s\n", FONTFILE, fontdir);
#  196|       snprintf (cmd, 512, "sleep 1; cp -a %s %s; sleep 1", FONTFILE, fontdir);
#  197|->     (void) system (cmd);
#  198|   
#  199|       fprintf (stderr, "D: Loading a config\n");

Error: COMPILER_WARNING (CWE-252): [#def89]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-bz106632.c:227:12: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#  227 |     (void) system (cmd);
#      |            ^~~~~~~~~~~~
#  225|       fprintf (stderr, "D: Removing %s\n", fontdir);
#  226|       snprintf (cmd, 512, "sleep 1; rm -f %s%s*; sleep 1", fontdir, FC_DIR_SEPARATOR_S);
#  227|->     (void) system (cmd);
#  228|       fprintf (stderr, "D: Reinitializing\n");
#  229|       if (FcConfigUptoDate(config))

Error: COMPILER_WARNING (CWE-252): [#def90]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-bz106632.c:275:12: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#  275 |     (void) system (cmd);
#      |            ^~~~~~~~~~~~
#  273|       fprintf (stderr, "D: Copying %s to %s\n", FONTFILE, fontdir);
#  274|       snprintf (cmd, 512, "sleep 1; cp -a %s %s; sleep 1", FONTFILE, fontdir);
#  275|->     (void) system (cmd);
#  276|       fprintf (stderr, "D: Reinitializing\n");
#  277|       if (FcConfigUptoDate(config))

Error: CPPCHECK_WARNING: [#def91]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-issue107.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def92]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-issue180.c:51:10: warning[deadcode.DeadStores]: Although the value stored to 'p' is used in the enclosing expression, the value is never actually read from 'p'
#   49|       }
#   50|       l = FcConfigGetCacheDirs (cfg);
#   51|->     if ((p = FcStrListNext (l)) != NULL)
#   52|       {
#   53|   	fprintf (stderr, "There was one or more cachedirs\n");

Error: CLANG_WARNING: [#def93]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-issue180.c:66:10: warning[deadcode.DeadStores]: Although the value stored to 'p' is used in the enclosing expression, the value is never actually read from 'p'
#   64|       }
#   65|       l = FcConfigGetCacheDirs (cfg);
#   66|->     if ((p = FcStrListNext (l)) != NULL)
#   67|       {
#   68|   	fprintf (stderr, "There was one or more cachedirs (with prefix)\n");

Error: CPPCHECK_WARNING: [#def94]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-migration.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def95]
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-migration.c: scope_hint: In function ‘unlink_dirs’
fontconfig-2.15.0-build/fontconfig-2.15.0/test/test-migration.c:102:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘n’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  100|   	    free (n);
#  101|   	n = malloc (l + len + 1);
#  102|-> 	strcpy (n, dir);
#  103|   	n[len] = '/';
#  104|   	strcpy (&n[len + 1], e->d_name);

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-77.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namefontconfig-2.15.0-6.fc41
store-results-to/tmp/tmpqh99x8sj/fontconfig-2.15.0-6.fc41.tar.xz
time-created2024-07-03 12:41:07
time-finished2024-07-03 12:43:55
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpqh99x8sj/fontconfig-2.15.0-6.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpqh99x8sj/fontconfig-2.15.0-6.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9