expat-2.7.3-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1]
expat-2.7.3/lib/xmltok.c:1374:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'utf8'
expat-2.7.3/lib/xmltok.c:1357:8: branch_false: following 'false' branch...
expat-2.7.3/lib/xmltok.c:1359:38: branch_false: ...to here
expat-2.7.3/lib/xmltok.c:1361:8: branch_true: following 'true' branch (when 'n == 0')...
expat-2.7.3/lib/xmltok.c:1362:15: branch_true: ...to here
expat-2.7.3/lib/xmltok.c:1364:10: branch_false: following 'false' branch...
expat-2.7.3/lib/xmltok.c:1367:7: branch_false: ...to here
expat-2.7.3/lib/xmltok.c:1374:5: danger: use of uninitialized value 'utf8' here
# 1372|         (*fromP)++;
# 1373|       }
# 1374|->     memcpy(*toP, utf8, n);
# 1375|       *toP += n;
# 1376|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
expat-2.7.3/tests/benchmark/benchmark.c:132:14: warning[-Wanalyzer-malloc-leak]: leak of ‘XMLBuf’
expat-2.7.3/tests/benchmark/benchmark.c:82:6: branch_true: following ‘true’ branch (when ‘argc > 1’)...
expat-2.7.3/tests/benchmark/benchmark.c:83:9: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:84:10: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:96:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:101:7: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:101:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:107:10: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:116:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:122:19: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:122:12: acquire_memory: allocated here
expat-2.7.3/tests/benchmark/benchmark.c:123:6: branch_false: following ‘false’ branch (when ‘XMLBuf’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:128:14: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:131:6: branch_true: following ‘true’ branch (when ‘j != 0’)...
expat-2.7.3/tests/benchmark/benchmark.c:132:14: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:132:14: throw: if ‘XML_ParserCreateNS’ throws an exception...
expat-2.7.3/tests/benchmark/benchmark.c:132:14: danger: ‘XMLBuf’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#  130|   
#  131|     if (ns)
#  132|->     parser = XML_ParserCreateNS(NULL, '!');
#  133|     else
#  134|       parser = XML_ParserCreate(NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
expat-2.7.3/tests/benchmark/benchmark.c:134:14: warning[-Wanalyzer-malloc-leak]: leak of ‘XMLBuf’
expat-2.7.3/tests/benchmark/benchmark.c:82:6: branch_true: following ‘true’ branch (when ‘argc > 1’)...
expat-2.7.3/tests/benchmark/benchmark.c:83:9: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:96:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:101:7: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:101:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:107:10: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:116:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:122:19: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:122:12: acquire_memory: allocated here
expat-2.7.3/tests/benchmark/benchmark.c:123:6: branch_false: following ‘false’ branch (when ‘XMLBuf’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:128:14: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:131:6: branch_false: following ‘false’ branch (when ‘j == 0’)...
expat-2.7.3/tests/benchmark/benchmark.c:134:14: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:134:14: throw: if ‘XML_ParserCreate’ throws an exception...
expat-2.7.3/tests/benchmark/benchmark.c:134:14: danger: ‘XMLBuf’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  132|       parser = XML_ParserCreateNS(NULL, '!');
#  133|     else
#  134|->     parser = XML_ParserCreate(NULL);
#  135|   
#  136|     i = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
expat-2.7.3/tests/benchmark/benchmark.c:149:13: warning[-Wanalyzer-malloc-leak]: leak of ‘XMLBufPtr’
expat-2.7.3/tests/benchmark/benchmark.c:82:6: branch_true: following ‘true’ branch (when ‘argc > 1’)...
expat-2.7.3/tests/benchmark/benchmark.c:83:9: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:96:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:101:7: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:101:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:107:10: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:116:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:122:19: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:122:12: acquire_memory: allocated here
expat-2.7.3/tests/benchmark/benchmark.c:123:6: branch_false: following ‘false’ branch (when ‘XMLBuf’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:128:14: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:138:10: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:141:14: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:144:10: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:148:7: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:148:7: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:149:13: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:149:13: throw: if ‘XML_Parse’ throws an exception...
expat-2.7.3/tests/benchmark/benchmark.c:149:13: danger: ‘XMLBufPtr’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  147|           parseBufferSize = bufferSize;
#  148|         assert(parseBufferSize <= (ptrdiff_t)bufferSize);
#  149|->       if (! XML_Parse(parser, XMLBufPtr, (int)parseBufferSize, isFinal)) {
#  150|           fprintf(stderr,
#  151|                   "error '%" XML_FMT_STR "' at line %" XML_FMT_INT_MOD

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
expat-2.7.3/tests/benchmark/benchmark.c:150:9: warning[-Wanalyzer-malloc-leak]: leak of ‘XMLBufPtr’
expat-2.7.3/tests/benchmark/benchmark.c:82:6: branch_true: following ‘true’ branch (when ‘argc > 1’)...
expat-2.7.3/tests/benchmark/benchmark.c:83:9: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:96:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:101:7: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:101:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:107:10: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:116:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:122:19: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:122:12: acquire_memory: allocated here
expat-2.7.3/tests/benchmark/benchmark.c:123:6: branch_false: following ‘false’ branch (when ‘XMLBuf’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:128:14: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:138:10: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:141:14: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:148:7: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:149:13: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:149:10: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:150:9: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:150:9: throw: if ‘XML_GetCurrentColumnNumber’ throws an exception...
expat-2.7.3/tests/benchmark/benchmark.c:150:9: danger: ‘XMLBufPtr’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
#  148|         assert(parseBufferSize <= (ptrdiff_t)bufferSize);
#  149|         if (! XML_Parse(parser, XMLBufPtr, (int)parseBufferSize, isFinal)) {
#  150|->         fprintf(stderr,
#  151|                   "error '%" XML_FMT_STR "' at line %" XML_FMT_INT_MOD
#  152|                   "u character %" XML_FMT_INT_MOD "u\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
expat-2.7.3/tests/benchmark/benchmark.c:160:7: warning[-Wanalyzer-malloc-leak]: leak of ‘XMLBufPtr’
expat-2.7.3/tests/benchmark/benchmark.c:82:6: branch_true: following ‘true’ branch (when ‘argc > 1’)...
expat-2.7.3/tests/benchmark/benchmark.c:83:9: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:92:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:96:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:101:7: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:101:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:107:10: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:108:6: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:116:6: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:122:19: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:122:12: acquire_memory: allocated here
expat-2.7.3/tests/benchmark/benchmark.c:123:6: branch_false: following ‘false’ branch (when ‘XMLBuf’ is non-NULL)...
expat-2.7.3/tests/benchmark/benchmark.c:128:14: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:138:10: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:141:14: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:144:10: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:148:7: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:148:7: branch_true: following ‘true’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:149:13: branch_true: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:149:10: branch_false: following ‘false’ branch...
expat-2.7.3/tests/benchmark/benchmark.c:160:17: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:161:14: branch_false: following ‘false’ branch (when ‘isFinal != 0’)...
expat-2.7.3/tests/benchmark/benchmark.c:162:12: branch_false: ...to here
expat-2.7.3/tests/benchmark/benchmark.c:164:5: throw: if ‘XML_ParserReset’ throws an exception...
expat-2.7.3/tests/benchmark/benchmark.c:160:7: danger: ‘XMLBufPtr’ leaks here; was allocated at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  158|           return 4;
#  159|         }
#  160|->       XMLBufPtr += bufferSize;
#  161|       } while (! isFinal);
#  162|       tend = clock();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
expat-2.7.3/xmlwf/xmlfile.c:93:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:190:1: enter_function: entry to ‘processStream’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:204:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:211:13: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:212:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:218:9: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:219:7: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:219:7: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:219:7: call_function: calling ‘reportError’ from ‘processStream’
#   91|   static void
#   92|   reportError(XML_Parser parser, const XML_Char *filename) {
#   93|->   enum XML_Error code = XML_GetErrorCode(parser);
#   94|     const XML_Char *message = XML_ErrorString(code);
#   95|     if (message)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
expat-2.7.3/xmlwf/xmlfile.c:94:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:190:1: enter_function: entry to ‘processStream’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:204:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:211:13: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:212:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:218:9: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:219:7: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:219:7: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:219:7: call_function: calling ‘reportError’ from ‘processStream’
#   92|   reportError(XML_Parser parser, const XML_Char *filename) {
#   93|     enum XML_Error code = XML_GetErrorCode(parser);
#   94|->   const XML_Char *message = XML_ErrorString(code);
#   95|     if (message)
#   96|       ftprintf(stdout,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
expat-2.7.3/xmlwf/xmlfile.c:96:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:190:1: enter_function: entry to ‘processStream’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:204:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:211:13: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:212:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:218:9: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:219:7: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:219:7: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:219:7: call_function: calling ‘reportError’ from ‘processStream’
#   94|     const XML_Char *message = XML_ErrorString(code);
#   95|     if (message)
#   96|->     ftprintf(stdout,
#   97|                T("%s") T(":%") T(XML_FMT_INT_MOD) T("u") T(":%")
#   98|                    T(XML_FMT_INT_MOD) T("u") T(": %s\n"),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
expat-2.7.3/xmlwf/xmlfile.c:170:3: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
expat-2.7.3/xmlwf/xmlfile.c:157:1: enter_function: entry to ‘externalEntityRefFilemap’
expat-2.7.3/xmlwf/xmlfile.c:169:14: call_function: calling ‘resolveSystemId’ from ‘externalEntityRefFilemap’
expat-2.7.3/xmlwf/xmlfile.c:169:14: return_function: returning to ‘externalEntityRefFilemap’ from ‘resolveSystemId’
expat-2.7.3/xmlwf/xmlfile.c:170:3: throw: if ‘XML_SetBase’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:170:3: danger: ‘s’ leaks here; was allocated at [(8)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/7)
#  168|     args.parser = entParser;
#  169|     filename = resolveSystemId(base, systemId, &s);
#  170|->   XML_SetBase(entParser, filename);
#  171|     filemapRes = filemap(filename, processFile, &args);
#  172|     switch (filemapRes) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
expat-2.7.3/xmlwf/xmlfile.c:171:16: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
expat-2.7.3/xmlwf/xmlfile.c:157:1: enter_function: entry to ‘externalEntityRefFilemap’
expat-2.7.3/xmlwf/xmlfile.c:169:14: call_function: calling ‘resolveSystemId’ from ‘externalEntityRefFilemap’
expat-2.7.3/xmlwf/xmlfile.c:169:14: return_function: returning to ‘externalEntityRefFilemap’ from ‘resolveSystemId’
expat-2.7.3/xmlwf/xmlfile.c:171:16: throw: if ‘filemap’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:171:16: danger: ‘s’ leaks here; was allocated at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7)
#  169|     filename = resolveSystemId(base, systemId, &s);
#  170|     XML_SetBase(entParser, filename);
#  171|->   filemapRes = filemap(filename, processFile, &args);
#  172|     switch (filemapRes) {
#  173|     case 0:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
expat-2.7.3/xmlwf/xmlfile.c:203:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:203:25: throw: if ‘XML_GetBuffer’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:203:25: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  201|     for (;;) {
#  202|       EXPAT_read_count_t nread;
#  203|->     char *buf = (char *)XML_GetBuffer(parser, g_read_size_bytes);
#  204|       if (! buf) {
#  205|         if (filename != NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def13]
expat-2.7.3/xmlwf/xmlfile.c:206:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:205:10: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:206:9: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:206:9: throw: if ‘close’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:206:9: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  204|       if (! buf) {
#  205|         if (filename != NULL)
#  206|->         close(fd);
#  207|         ftprintf(stderr, T("%s: out of memory\n"),
#  208|                  filename != NULL ? filename : T("xmlwf"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
expat-2.7.3/xmlwf/xmlfile.c:213:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:204:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:211:13: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:213:7: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:213:7: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:213:7: throw: if ‘perror’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:213:7: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  211|       nread = EXPAT_read(fd, buf, (EXPAT_read_req_t)g_read_size_bytes);
#  212|       if (nread < 0) {
#  213|->       tperror(filename != NULL ? filename : T("STDIN"));
#  214|         if (filename != NULL)
#  215|           close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def15]
expat-2.7.3/xmlwf/xmlfile.c:215:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:204:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:211:13: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:213:7: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:213:7: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:214:10: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:215:9: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:215:9: throw: if ‘close’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:215:9: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  213|         tperror(filename != NULL ? filename : T("STDIN"));
#  214|         if (filename != NULL)
#  215|->         close(fd);
#  216|         return 0;
#  217|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
expat-2.7.3/xmlwf/xmlfile.c:218:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:204:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:211:13: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:212:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:218:9: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:218:9: throw: if ‘XML_ParseBuffer’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:218:9: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  216|         return 0;
#  217|       }
#  218|->     if (XML_ParseBuffer(parser, (int)nread, nread == 0) == XML_STATUS_ERROR) {
#  219|         reportError(parser, filename != NULL ? filename : T("STDIN"));
#  220|         if (filename != NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
expat-2.7.3/xmlwf/xmlfile.c:226:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
expat-2.7.3/xmlwf/xmlfile.c:194:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:195:10: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:195:10: acquire_resource: opened here
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:196:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:204:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:211:13: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:212:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:218:9: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:218:8: branch_false: following ‘false’ branch...
expat-2.7.3/xmlwf/xmlfile.c:224:8: branch_false: ...to here
expat-2.7.3/xmlwf/xmlfile.c:225:10: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)...
expat-2.7.3/xmlwf/xmlfile.c:226:9: branch_true: ...to here
expat-2.7.3/xmlwf/xmlfile.c:226:9: throw: if ‘close’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:226:9: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  224|       if (nread == 0) {
#  225|         if (filename != NULL)
#  226|->         close(fd);
#  227|         break;
#  228|         ;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
expat-2.7.3/xmlwf/xmlfile.c:244:3: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
expat-2.7.3/xmlwf/xmlfile.c:235:1: enter_function: entry to ‘externalEntityRefStream’
expat-2.7.3/xmlwf/xmlfile.c:243:14: call_function: calling ‘resolveSystemId’ from ‘externalEntityRefStream’
expat-2.7.3/xmlwf/xmlfile.c:243:14: return_function: returning to ‘externalEntityRefStream’ from ‘resolveSystemId’
expat-2.7.3/xmlwf/xmlfile.c:244:3: throw: if ‘XML_SetBase’ throws an exception...
expat-2.7.3/xmlwf/xmlfile.c:244:3: danger: ‘s’ leaks here; was allocated at [(8)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/7)
#  242|     UNUSED_P(publicId);
#  243|     filename = resolveSystemId(base, systemId, &s);
#  244|->   XML_SetBase(entParser, filename);
#  245|     ret = processStream(filename, entParser);
#  246|     free(s);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
expat-2.7.3/xmlwf/xmlwf.c:408:3: warning[-Wanalyzer-malloc-leak]: leak of ‘notations’
expat-2.7.3/xmlwf/xmlwf.c:391:6: branch_false: following ‘false’ branch (when ‘notationCount != 0’)...
expat-2.7.3/xmlwf/xmlwf.c:398:15: branch_false: ...to here
expat-2.7.3/xmlwf/xmlwf.c:398:15: acquire_memory: allocated here
expat-2.7.3/xmlwf/xmlwf.c:399:6: branch_false: following ‘false’ branch (when ‘notations’ is non-NULL)...
expat-2.7.3/xmlwf/xmlwf.c:399:6: branch_false: ...to here
expat-2.7.3/xmlwf/xmlwf.c:408:3: throw: if ‘qsort’ throws an exception...
expat-2.7.3/xmlwf/xmlwf.c:408:3: danger: ‘notations’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  406|       notations[i] = p;
#  407|     }
#  408|->   qsort(notations, notationCount, sizeof(NotationList *), notationCmp);
#  409|   
#  410|     /* Output the DOCTYPE header */

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-71.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameexpat-2.7.3-1.fc44
store-results-to/tmp/tmpjghjomkp/expat-2.7.3-1.fc44.tar.xz
time-created2026-01-08 16:10:03
time-finished2026-01-08 16:11:55
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpjghjomkp/expat-2.7.3-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpjghjomkp/expat-2.7.3-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9