c-ares-1.34.6-1.fc44

List of Findings

Error: COMPILER_WARNING: [#def1] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-2XrF7F/src.c:31:25: error[error]: unknown type name ‘SOCKET’

Error: COMPILER_WARNING: [#def2] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-6urGrF/CheckSymbolExists.c:32:19: error[error]: ‘ConvertInterfaceIndexToLuid’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def3] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-79T6MY/CheckSymbolExists.c:32:19: error[error]: ‘IoctlSocket’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def4] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-8GCGbQ/CheckSymbolExists.c:32:19: error[error]: ‘kqueue’ undeclared (first use in this function); did you mean ‘sigqueue’?

Error: COMPILER_WARNING: [#def5] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-AYuOrI/CheckSymbolExists.c:32:19: error[error]: ‘strcmpi’ undeclared (first use in this function); did you mean ‘strcmp’?

Error: COMPILER_WARNING: [#def6] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-DglZvb/CheckSymbolExists.c:32:19: error[error]: ‘ConvertInterfaceLuidToNameA’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def7] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-DkyRAL/CheckSymbolExists.c:32:19: error[error]: ‘NotifyIpInterfaceChange’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def8] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-OKBBRJ/CheckSymbolExists.c:32:19: error[error]: ‘strnicmp’ undeclared (first use in this function); did you mean ‘strncmp’?

Error: COMPILER_WARNING: [#def9] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-U5iBmz/CheckSymbolExists.c:32:19: error[error]: ‘connectx’ undeclared (first use in this function); did you mean ‘connect’?

Error: COMPILER_WARNING: [#def10] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-WnLsAG/CheckSymbolExists.c:32:19: error[error]: ‘stricmp’ undeclared (first use in this function); did you mean ‘strncmp’?

Error: COMPILER_WARNING: [#def11] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-d6qC9f/CheckSymbolExists.c:32:19: error[error]: ‘RegisterWaitForSingleObject’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def12] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-kwQf6N/CheckSymbolExists.c:32:19: error[error]: ‘strncmpi’ undeclared (first use in this function); did you mean ‘strncmp’?

Error: COMPILER_WARNING: [#def13] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-o9R3Xw/CheckSymbolExists.c:32:19: error[error]: ‘closesocket’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def14] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-pTpyf1/CheckSymbolExists.c:32:19: error[error]: ‘GetBestRoute2’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def15] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-wPhFyG/CheckSymbolExists.c:32:19: error[error]: ‘CloseSocket’ undeclared (first use in this function)

Error: COMPILER_WARNING: [#def16] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-ylEzdR/CheckSymbolExists.c:32:19: error[error]: ‘SO_NONBLOCK’ undeclared (first use in this function); did you mean ‘O_NONBLOCK’?

Error: COMPILER_WARNING: [#def17] [important]
c-ares-1.34.6/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-zv4Sfj/CheckSymbolExists.c:32:19: error[error]: ‘ioctlsocket’ undeclared (first use in this function)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
c-ares-1.34.6/src/lib/ares_getnameinfo.c:173:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘addr’
c-ares-1.34.6/src/lib/ares_getnameinfo.c:99:6: branch_true: following ‘true’ branch (when ‘sa’ is non-NULL)...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:99:13: branch_true: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:103:14: branch_true: following ‘true’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:118:7: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:131:9: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:131:8: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:162:17: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:163:10: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:167:7: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:171:10: branch_true: following ‘true’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:172:9: branch_true: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:173:9: danger: dereference of NULL ‘addr’
#  171|         if (sa->sa_family == AF_INET) {
#  172|           niquery->family = AF_INET;
#  173|->         memcpy(&niquery->addr.addr4, addr, sizeof(niquery->addr.addr4));
#  174|           ares_gethostbyaddr_nolock(channel, &addr->sin_addr,
#  175|                                     sizeof(struct in_addr), AF_INET,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def19]
c-ares-1.34.6/src/lib/ares_getnameinfo.c:179:9: warning[-Wanalyzer-null-argument]: use of NULL ‘addr6’ where non-null expected
c-ares-1.34.6/src/lib/ares_getnameinfo.c:99:6: branch_true: following ‘true’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:118:7: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:131:9: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:131:8: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:162:17: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:163:10: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:167:7: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:171:10: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/ares_getnameinfo.c:178:9: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_getnameinfo.c:179:9: danger: argument 2 (‘addr6’) NULL where non-null expected
#  177|         } else {
#  178|           niquery->family = AF_INET6;
#  179|->         memcpy(&niquery->addr.addr6, addr6, sizeof(niquery->addr.addr6));
#  180|           ares_gethostbyaddr_nolock(channel, &addr6->sin6_addr,
#  181|                                     sizeof(struct ares_in6_addr), AF_INET6,

Error: COMPILER_WARNING: [#def20]
c-ares-1.34.6/src/lib/ares_metrics.c: scope_hint: In function ‘ares_metrics_server_timeout’
c-ares-1.34.6/src/lib/ares_metrics.c:221:30: warning[-Warray-bounds=]: array subscript 5 is above array bounds of ‘const struct ares_server_metrics_t[5]’
#  221 |     if (ts != server->metrics[i].ts ||
#      |               ~~~~~~~~~~~~~~~^~~
c-ares-1.34.6/src/lib/ares_private.h:63: included_from: Included from here.
c-ares-1.34.6/src/lib/ares_metrics.c:98: included_from: Included from here.
c-ares-1.34.6/src/lib/ares_conn.h:158:25: note: while referencing ‘metrics’
#  158 |   ares_server_metrics_t metrics[ARES_METRIC_COUNT];
#      |                         ^~~~~~~
#  219|       /* This ts has been invalidated, see if we should use the previous
#  220|        * time period */
#  221|->     if (ts != server->metrics[i].ts ||
#  222|           server->metrics[i].total_count < MIN_COUNT_FOR_AVERAGE) {
#  223|         time_t prev_ts = ares_metric_timestamp(i, now, ARES_TRUE);

Error: COMPILER_WARNING: [#def21]
c-ares-1.34.6/src/lib/ares_metrics.c:222:24: warning[-Warray-bounds=]: array subscript 5 is above array bounds of ‘const struct ares_server_metrics_t[5]’
#  222 |         server->metrics[i].total_count < MIN_COUNT_FOR_AVERAGE) {
#      |         ~~~~~~~~~~~~~~~^~~
c-ares-1.34.6/src/lib/ares_conn.h:158:25: note: while referencing ‘metrics’
#  158 |   ares_server_metrics_t metrics[ARES_METRIC_COUNT];
#      |                         ^~~~~~~
#  220|        * time period */
#  221|       if (ts != server->metrics[i].ts ||
#  222|->         server->metrics[i].total_count < MIN_COUNT_FOR_AVERAGE) {
#  223|         time_t prev_ts = ares_metric_timestamp(i, now, ARES_TRUE);
#  224|         if (prev_ts != server->metrics[i].prev_ts ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
c-ares-1.34.6/src/lib/ares_set_socket_functions.c:149:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
c-ares-1.34.6/src/lib/ares_set_socket_functions.c:204:22: enter_function: entry to ‘default_asocket’
c-ares-1.34.6/src/lib/ares_set_socket_functions.c:210:7: acquire_resource: socket created here
c-ares-1.34.6/src/lib/ares_set_socket_functions.c:211:6: branch_false: following ‘false’ branch (when ‘s != -1’)...
c-ares-1.34.6/src/lib/ares_set_socket_functions.c:215:7: branch_false: ...to here
c-ares-1.34.6/src/lib/ares_set_socket_functions.c:215:7: call_function: calling ‘setsocknonblock’ from ‘default_asocket’
#  147|     /* most recent unix versions */
#  148|     int flags;
#  149|->   flags = fcntl(sockfd, F_GETFL, 0);
#  150|     if (nonblock) {
#  151|       return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);

Error: CPPCHECK_WARNING (CWE-457): [#def23]
c-ares-1.34.6/src/lib/ares_sysconfig_files.c:355: error[legacyUninitvar]: Uninitialized variable: lookupstr
#  353|   
#  354|       /* Look for a duplicate and ignore */
#  355|->     if (memchr(lookupstr, ch, lookupstr_cnt) == NULL) {
#  356|         lookupstr[lookupstr_cnt++] = ch;
#  357|       }

Error: COMPILER_WARNING (CWE-252): [#def24]
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c: scope_hint: In function ‘ares_pipeevent_signal’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:120:9: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#  120 |   (void)write(p->filedes[1], "1", 1);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  118|   
#  119|     p = e->data;
#  120|->   (void)write(p->filedes[1], "1", 1);
#  121|   }
#  122|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:155:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:144:15: enter_function: entry to ‘ares_pipeevent_create’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:150:7: call_function: calling ‘ares_pipeevent_init’ from ‘ares_pipeevent_create’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:150:7: return_function: returning to ‘ares_pipeevent_create’ from ‘ares_pipeevent_init’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:151:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:156:30: branch_false: ...to here
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:155:12: danger: leaks here
#  153|     }
#  154|   
#  155|->   status = ares_event_update(&event, e, ARES_EVENT_FLAG_READ, ares_pipeevent_cb,
#  156|                                p->filedes[0], p, ares_pipeevent_destroy_cb,
#  157|                                ares_pipeevent_signal);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:155:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*<unknown>.filedes[0]’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:144:15: enter_function: entry to ‘ares_pipeevent_create’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:150:7: call_function: calling ‘ares_pipeevent_init’ from ‘ares_pipeevent_create’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:150:7: return_function: returning to ‘ares_pipeevent_create’ from ‘ares_pipeevent_init’
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:151:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:156:30: branch_false: ...to here
c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c:155:12: danger: ‘*<unknown>.filedes[0]’ leaks here
#  153|     }
#  154|   
#  155|->   status = ares_event_update(&event, e, ARES_EVENT_FLAG_READ, ares_pipeevent_cb,
#  156|                                p->filedes[0], p, ares_pipeevent_destroy_cb,
#  157|                                ares_pipeevent_signal);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
c-ares-1.34.6/src/lib/str/ares_buf.c:286:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1423:15: enter_function: entry to ‘ares_buf_load_file’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_resource: opened here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1460:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1464:3: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1471:6: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1471:6: branch_false: following ‘false’ branch (when ‘len != 0’)...
c-ares-1.34.6/src/lib/str/ares_buf.c:1477:3: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1478:13: call_function: calling ‘ares_buf_append_start’ from ‘ares_buf_load_file’
#  284|     ares_status_t status;
#  285|   
#  286|->   if (len == NULL || *len == 0) {
#  287|       return NULL;
#  288|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
c-ares-1.34.6/src/lib/str/ares_buf.c:286:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1423:15: enter_function: entry to ‘ares_buf_load_file’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_memory: allocated here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1460:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1464:3: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1471:6: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1471:6: branch_false: following ‘false’ branch (when ‘len != 0’)...
c-ares-1.34.6/src/lib/str/ares_buf.c:1477:3: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1478:13: call_function: calling ‘ares_buf_append_start’ from ‘ares_buf_load_file’
#  284|     ares_status_t status;
#  285|   
#  286|->   if (len == NULL || *len == 0) {
#  287|       return NULL;
#  288|     }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def29]
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_resource: opened here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: throw: if ‘fseek’ throws an exception...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1452|   
# 1453|     /* Get length portably, fstat() is POSIX, not C */
# 1454|->   if (fseek(fp, 0, SEEK_END) != 0) {
# 1455|       status = ARES_EFILE; /* LCOV_EXCL_LINE: DefensiveCoding */
# 1456|       goto done;           /* LCOV_EXCL_LINE: DefensiveCoding */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_memory: allocated here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: throw: if ‘fseek’ throws an exception...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 1452|   
# 1453|     /* Get length portably, fstat() is POSIX, not C */
# 1454|->   if (fseek(fp, 0, SEEK_END) != 0) {
# 1455|       status = ARES_EFILE; /* LCOV_EXCL_LINE: DefensiveCoding */
# 1456|       goto done;           /* LCOV_EXCL_LINE: DefensiveCoding */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_resource: opened here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: throw: if ‘ftell’ throws an exception...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 1457|     }
# 1458|   
# 1459|->   ftell_len = ftell(fp);
# 1460|     if (ftell_len < 0) {
# 1461|       status = ARES_EFILE; /* LCOV_EXCL_LINE: DefensiveCoding */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_memory: allocated here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: throw: if ‘ftell’ throws an exception...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 1457|     }
# 1458|   
# 1459|->   ftell_len = ftell(fp);
# 1460|     if (ftell_len < 0) {
# 1461|       status = ARES_EFILE; /* LCOV_EXCL_LINE: DefensiveCoding */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_resource: opened here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1460:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1464:3: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:7: throw: if ‘fseek’ throws an exception...
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:7: danger: ‘fopen(filename, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1464|     len = (size_t)ftell_len;
# 1465|   
# 1466|->   if (fseek(fp, 0, SEEK_SET) != 0) {
# 1467|       status = ARES_EFILE; /* LCOV_EXCL_LINE: DefensiveCoding */
# 1468|       goto done;           /* LCOV_EXCL_LINE: DefensiveCoding */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "rb")’
c-ares-1.34.6/src/lib/str/ares_buf.c:1432:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1436:8: acquire_memory: allocated here
c-ares-1.34.6/src/lib/str/ares_buf.c:1437:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:7: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1454:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1459:15: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1460:6: branch_false: following ‘false’ branch...
c-ares-1.34.6/src/lib/str/ares_buf.c:1464:3: branch_false: ...to here
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:7: throw: if ‘fseek’ throws an exception...
c-ares-1.34.6/src/lib/str/ares_buf.c:1466:7: danger: ‘fopen(filename, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 1464|     len = (size_t)ftell_len;
# 1465|   
# 1466|->   if (fseek(fp, 0, SEEK_SET) != 0) {
# 1467|       status = ARES_EFILE; /* LCOV_EXCL_LINE: DefensiveCoding */
# 1468|       goto done;           /* LCOV_EXCL_LINE: DefensiveCoding */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
c-ares-1.34.6/src/lib/util/ares_rand.c:335:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘*state.state.rand_file’
c-ares-1.34.6/src/lib/util/ares_rand.c:383:16: enter_function: entry to ‘ares_generate_new_id’
c-ares-1.34.6/src/lib/util/ares_rand.c:387:3: call_function: calling ‘ares_rand_bytes’ from ‘ares_generate_new_id’
#  333|         case ARES_RAND_FILE:
#  334|           while (1) {
#  335|->           size_t rv = fread(buf + bytes_read, 1, len - bytes_read,
#  336|                               state->state.rand_file);
#  337|             if (rv == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
c-ares-1.34.6/src/lib/util/ares_rand.c:335:23: warning[-Wanalyzer-malloc-leak]: leak of ‘*state.state.rand_file’
c-ares-1.34.6/src/lib/util/ares_rand.c:383:16: enter_function: entry to ‘ares_generate_new_id’
c-ares-1.34.6/src/lib/util/ares_rand.c:387:3: call_function: calling ‘ares_rand_bytes’ from ‘ares_generate_new_id’
#  333|         case ARES_RAND_FILE:
#  334|           while (1) {
#  335|->           size_t rv = fread(buf + bytes_read, 1, len - bytes_read,
#  336|                               state->state.rand_file);
#  337|             if (rv == 0) {

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-112.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-namec-ares-1.34.6-1.fc44
store-results-to/tmp/tmpb_ku2psk/c-ares-1.34.6-1.fc44.tar.xz
time-created2026-01-08 15:40:22
time-finished2026-01-08 15:41:57
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpb_ku2psk/c-ares-1.34.6-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpb_ku2psk/c-ares-1.34.6-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9