dnsmasq-2.90-1.fc41
List of Defects
Error: CPPCHECK_WARNING: [#def1]
dnsmasq-2.90-build/dnsmasq-2.90/contrib/lease-tools/dhcp_lease_time.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def2]
dnsmasq-2.90-build/dnsmasq-2.90/contrib/lease-tools/dhcp_release.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def3]
dnsmasq-2.90-build/dnsmasq-2.90/contrib/lease-tools/dhcp_release.c:219:49: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>=' is a garbage value
# 217| }
# 218|
# 219|-> for (h = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(h, (size_t)len); h = NLMSG_NEXT(h, len))
# 220| if (h->nlmsg_type == NLMSG_DONE)
# 221| {
Error: CPPCHECK_WARNING: [#def4]
dnsmasq-2.90-build/dnsmasq-2.90/contrib/lease-tools/dhcp_release6.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-457): [#def5]
dnsmasq-2.90-build/dnsmasq-2.90/contrib/lease-tools/dhcp_release6.c: scope_hint: In function ‘create_release_packet’
dnsmasq-2.90-build/dnsmasq-2.90/contrib/lease-tools/dhcp_release6.c:226:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&client_option’
/usr/include/arpa/inet.h:22: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/contrib/lease-tools/dhcp_release6.c:39: included_from: Included from here.
# 224| struct dhcp6_iana_option iana_option = create_iana_option(iaid, iaaddr_option);
# 225| int offset = 4;
# 226|-> memcpy(result.buf + offset, &client_option, ntohs(client_option.len) + 2*sizeof(uint16_t));
# 227| offset += (ntohs(client_option.len)+ 2 *sizeof(uint16_t) );
# 228| memcpy(result.buf + offset, &server_option, ntohs(server_option.len) + 2*sizeof(uint16_t) );
Error: CPPCHECK_WARNING: [#def6]
dnsmasq-2.90-build/dnsmasq-2.90/src/arp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def7]
dnsmasq-2.90-build/dnsmasq-2.90/src/auth.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def8]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-682): [#def9]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c:231: error[nullPointerArithmetic]: Pointer addition with NULL pointer.
# 229| const unsigned char *mix_tab = (const unsigned char*)typestr;
# 230|
# 231|-> while((c = (unsigned char) *name++))
# 232| {
# 233| /* don't use tolower and friends here - they may be messed up by LOCALE */
Error: CPPCHECK_WARNING (CWE-476): [#def10]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c:231: warning[nullPointer]: Possible null pointer dereference: name++
# 229| const unsigned char *mix_tab = (const unsigned char*)typestr;
# 230|
# 231|-> while((c = (unsigned char) *name++))
# 232| {
# 233| /* don't use tolower and friends here - they may be messed up by LOCALE */
Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c: scope_hint: In function ‘hash_bucket’
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c:231:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘name’
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c: scope_hint: In function ‘hash_bucket’
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c: scope_hint: In function ‘hash_bucket’
# 229| const unsigned char *mix_tab = (const unsigned char*)typestr;
# 230|
# 231|-> while((c = (unsigned char) *name++))
# 232| {
# 233| /* don't use tolower and friends here - they may be messed up by LOCALE */
Error: CLANG_WARNING: [#def12]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c:480:47: warning[core.NullDereference]: Dereference of null pointer
# 478| {
# 479| unsigned short rrc = (crecp->flags & F_KEYTAG) ? crecp->addr.rrblock.rrtype : crecp->addr.rrdata.rrtype;
# 480|-> unsigned short rra = (flags & F_KEYTAG) ? addr->rrblock.rrtype : addr->rrdata.rrtype;
# 481|
# 482| if (rrc == rra)
Error: CLANG_WARNING: [#def13]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c:480:70: warning[core.NullDereference]: Dereference of null pointer
# 478| {
# 479| unsigned short rrc = (crecp->flags & F_KEYTAG) ? crecp->addr.rrblock.rrtype : crecp->addr.rrdata.rrtype;
# 480|-> unsigned short rra = (flags & F_KEYTAG) ? addr->rrblock.rrtype : addr->rrdata.rrtype;
# 481|
# 482| if (rrc == rra)
Error: CLANG_WARNING: [#def14]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c:1903:5: warning[deadcode.DeadStores]: Value stored to 'p' is never read
# 1901| #endif
# 1902| if(cache->flags & (F_HOSTS | F_CONFIG) && cache->uid > 0)
# 1903|-> p += sprintf(p, " %-40.40s", record_source(cache->uid));
# 1904|
# 1905| my_syslog(LOG_INFO, "%s", buff);
Error: CLANG_WARNING: [#def15]
dnsmasq-2.90-build/dnsmasq-2.90/src/cache.c:1959:93: warning[core.DivideZero]: Division by zero
# 1957| port = prettyprint_addr(&serv->addr, daemon->addrbuff);
# 1958| my_syslog(LOG_INFO, _("server %s#%d: queries sent %u, retried %u, failed %u, nxdomain replies %u, avg. latency %ums"),
# 1959|-> daemon->addrbuff, port, queries, retrys, failed_queries, nxdomain_replies, sigma_latency/count_latency);
# 1960| }
# 1961|
Error: CPPCHECK_WARNING: [#def16]
dnsmasq-2.90-build/dnsmasq-2.90/src/dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def17]
dnsmasq-2.90-build/dnsmasq-2.90/src/dbus.c:766:52: warning[core.DivideZero]: Division by zero
# 764| add_dict_int(&dict_array, "nxdomain", serv->nxdomain_replies);
# 765| add_dict_int(&dict_array, "retries", serv->retrys);
# 766|-> add_dict_int(&dict_array, "latency", sigma_latency/count_latency);
# 767|
# 768| dbus_message_iter_close_container(&server_array, &dict_array);
Error: CPPCHECK_WARNING: [#def18]
dnsmasq-2.90-build/dnsmasq-2.90/src/dhcp-common.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def19]
dnsmasq-2.90-build/dnsmasq-2.90/src/dhcp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def20]
dnsmasq-2.90-build/dnsmasq-2.90/src/dhcp6.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def21]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c: scope_hint: In function ‘main’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c:155:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor
# 153| ensure that we're not using those fds for real stuff. */
# 154| for (i = 0; i < 3; i++)
# 155|-> open("/dev/null", O_RDWR);
# 156|
# 157| /* Close any file descriptors we inherited apart from std{in|out|err} */
Error: CLANG_WARNING: [#def23]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c:1916:24: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
# 1914|
# 1915| /* if we can find the arrival interface, check it's one that's allowed */
# 1916|-> if ((if_index = tcp_interface(confd, tcp_addr.sa.sa_family)) != 0 &&
# 1917| indextoname(listener->tcpfd, if_index, intr_name))
# 1918| {
Error: GCC_ANALYZER_WARNING (CWE-457): [#def24]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c: scope_hint: In function ‘check_dns_listeners’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c:2025:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pipefd[1]’
# 2023|
# 2024| close(daemon->netlinkfd);
# 2025|-> read_write(pipefd[1], &a, 1, 0);
# 2026| #endif
# 2027| alarm(CHILD_LIFETIME);
Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c: scope_hint: In function ‘check_dns_listeners’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c:2063:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
# 2061| }
# 2062| }
# 2063|-> }
# 2064|
# 2065| #ifdef HAVE_DHCP
Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c:2063:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
# 2061| }
# 2062| }
# 2063|-> }
# 2064|
# 2065| #ifdef HAVE_DHCP
Error: CLANG_WARNING: [#def27]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.c:2211:13: warning[core.UndefinedBinaryOperatorResult]: The right operand of '==' is a garbage value
# 2209| if (poll_check(fd, POLLIN) &&
# 2210| recvfrom(fd, &packet, sizeof(packet), 0, (struct sockaddr *)&faddr, &len) == sizeof(packet) &&
# 2211|-> addr == faddr.sin_addr.s_addr &&
# 2212| packet.icmp.icmp_type == ICMP_ECHOREPLY &&
# 2213| packet.icmp.icmp_seq == 0 &&
Error: CPPCHECK_WARNING: [#def28]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnssec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING (CWE-457): [#def29]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnssec.c:163: warning[uninitvar]: Uninitialized variable: state->c
# 161| int d;
# 162|
# 163|-> if (state->op && state->c != 1)
# 164| {
# 165| state->op++;
Error: CLANG_WARNING: [#def30]
dnsmasq-2.90-build/dnsmasq-2.90/src/dnssec.c:821:15: warning[core.NullDereference]: Array access (from variable 'cached_digest') results in a null pointer dereference
# 819|
# 820| if (valid_digest[recp1->addr.ds.digest])
# 821|-> digest = cached_digest[recp1->addr.ds.digest];
# 822| else
# 823| {
Error: CPPCHECK_WARNING: [#def31]
dnsmasq-2.90-build/dnsmasq-2.90/src/domain-match.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def32]
dnsmasq-2.90-build/dnsmasq-2.90/src/domain.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def33]
dnsmasq-2.90-build/dnsmasq-2.90/src/dump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def34]
dnsmasq-2.90-build/dnsmasq-2.90/src/edns0.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-457): [#def35]
dnsmasq-2.90-build/dnsmasq-2.90/src/edns0.c: scope_hint: In function ‘add_dns_client’
dnsmasq-2.90-build/dnsmasq-2.90/src/edns0.c:293:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘encode[0]’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:59: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/edns0.c:17: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:291:25: note: in expansion of macro ‘option_var’
dnsmasq-2.90-build/dnsmasq-2.90/src/edns0.c:289:12: note: in expansion of macro ‘option_bool’
/usr/include/sys/un.h:38: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:101: 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
# 291|
# 292| if (replace != 0 || maclen == 6)
# 293|-> plen = add_pseudoheader(header, plen, limit, PACKETSZ, EDNS0_OPTION_NOMDEVICEID, (unsigned char *)encode, strlen(encode), 0, replace);
# 294|
# 295| return plen;
Error: CPPCHECK_WARNING: [#def36]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def37]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:127:26: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
# 125| static void log_query_mysockaddr(unsigned int flags, char *name, union mysockaddr *addr, char *arg, unsigned short type)
# 126| {
# 127|-> if (addr->sa.sa_family == AF_INET)
# 128| {
# 129| if (flags & F_SERVER)
Error: CLANG_WARNING: [#def38]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:580:20: warning[core.CallAndMessage]: 7th function call argument is an uninitialized value
# 578| if (udpfd != -1)
# 579| {
# 580|-> if (!(plen = make_local_answer(flags, gotname, plen, header, daemon->namebuff, limit, first, last, ede)))
# 581| return 0;
# 582|
Error: CLANG_WARNING: [#def39]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:1129:31: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
# 1127|
# 1128| /* Determine the address of the server replying so that we can mark that as good */
# 1129|-> if (serveraddr.sa.sa_family == AF_INET6)
# 1130| serveraddr.in6.sin6_flowinfo = 0;
# 1131|
Error: CLANG_WARNING: [#def40]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2196:34: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value
# 2194| struct addrlist *addr;
# 2195|
# 2196|-> if (peer_addr.sa.sa_family == AF_INET6)
# 2197| {
# 2198| for (addr = daemon->interface_addrs; addr; addr = addr->next)
Error: CLANG_WARNING: [#def41]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2411:9: warning[deadcode.DeadStores]: Value stored to 'ede' is never read
# 2409| if ((m = tcp_talk(first, last, start, packet, size, have_mark, mark, &serv)) == 0)
# 2410| {
# 2411|-> ede = EDE_NETERR;
# 2412| break;
# 2413| }
Error: CLANG_WARNING: [#def42]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2485:14: warning[core.CallAndMessage]: 7th function call argument is an uninitialized value
# 2483| if (m == 0)
# 2484| {
# 2485|-> if (!(m = make_local_answer(flags, gotname, size, header, daemon->namebuff,
# 2486| ((char *) header) + 65536, first, last, ede)))
# 2487| break;
Error: GCC_ANALYZER_WARNING (CWE-457): [#def43]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c: scope_hint: In function ‘tcp_request’
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2485:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘last’
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:17: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:291:25: note: in expansion of macro ‘option_var’
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2178:7: note: in expansion of macro ‘option_bool’
# 2483| if (m == 0)
# 2484| {
# 2485|-> if (!(m = make_local_answer(flags, gotname, size, header, daemon->namebuff,
# 2486| ((char *) header) + 65536, first, last, ede)))
# 2487| break;
Error: CLANG_WARNING: [#def44]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2503:8: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 2501| ede = EDE_UNSET;
# 2502|
# 2503|-> if (filtered)
# 2504| ede = EDE_FILTERED;
# 2505| else if (stale)
Error: GCC_ANALYZER_WARNING (CWE-457): [#def45]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2534:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘stale’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:291:25: note: in expansion of macro ‘option_var’
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2178:7: note: in expansion of macro ‘option_bool’
# 2532| connection to signal that to the client. Then set do_stale and loop round
# 2533| once more to try and get fresh data, after which we exit. */
# 2534|-> if (stale)
# 2535| {
# 2536| shutdown(confd, SHUT_RDWR);
Error: CLANG_WARNING: [#def46]
dnsmasq-2.90-build/dnsmasq-2.90/src/forward.c:2534:11: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 2532| connection to signal that to the client. Then set do_stale and loop round
# 2533| once more to try and get fresh data, after which we exit. */
# 2534|-> if (stale)
# 2535| {
# 2536| shutdown(confd, SHUT_RDWR);
Error: CPPCHECK_WARNING: [#def47]
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-457): [#def48]
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c: scope_hint: In function ‘create_helper’
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c:516:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pipeout[0]’
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c:17: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:291:25: note: in expansion of macro ‘option_var’
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c:514:16: note: in expansion of macro ‘option_bool’
# 514| if (!option_bool(OPT_DEBUG))
# 515| {
# 516|-> close(pipeout[0]);
# 517| close(pipeout[1]);
# 518| }
Error: GCC_ANALYZER_WARNING (CWE-457): [#def49]
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c:529:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pipeout[1]’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:291:25: note: in expansion of macro ‘option_var’
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c:525:16: note: in expansion of macro ‘option_bool’
# 527| FILE *fp;
# 528|
# 529|-> close(pipeout[1]);
# 530|
# 531| /* Read lines sent to stdout/err by the script and pass them back to be logged */
Error: GCC_ANALYZER_WARNING (CWE-457): [#def50]
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c:578:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pipeout[0]’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:291:25: note: in expansion of macro ‘option_var’
dnsmasq-2.90-build/dnsmasq-2.90/src/helper.c:575:12: note: in expansion of macro ‘option_bool’
# 576| {
# 577| /* map stdout/stderr of script to pipeout */
# 578|-> close(pipeout[0]);
# 579| dup2(pipeout[1], STDOUT_FILENO);
# 580| dup2(pipeout[1], STDERR_FILENO);
Error: CPPCHECK_WARNING: [#def51]
dnsmasq-2.90-build/dnsmasq-2.90/src/lease.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def52]
dnsmasq-2.90-build/dnsmasq-2.90/src/lease.c:817:7: warning[deadcode.DeadStores]: Value stored to 'len' is never read
# 815| {
# 816| exp = 0;
# 817|-> len = 0;
# 818| }
# 819| else
Error: CPPCHECK_WARNING: [#def53]
dnsmasq-2.90-build/dnsmasq-2.90/src/log.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def54]
dnsmasq-2.90-build/dnsmasq-2.90/src/network.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def55]
dnsmasq-2.90-build/dnsmasq-2.90/src/network.c:951:8: warning[deadcode.DeadStores]: Although the value stored to 'rc' is used in the enclosing expression, the value is never actually read from 'rc'
# 949| goto err;
# 950|
# 951|-> if ((rc = bind(fd, (struct sockaddr *)addr, sa_len(addr))) == -1)
# 952| goto err;
# 953|
Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
dnsmasq-2.90-build/dnsmasq-2.90/src/network.c: scope_hint: In function ‘create_listeners’
dnsmasq-2.90-build/dnsmasq-2.90/src/network.c:1133:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tcpfd’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:118: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/network.c:17: included_from: Included from here.
# 1131| }
# 1132|
# 1133|-> return l;
# 1134| }
# 1135|
Error: CPPCHECK_WARNING: [#def57]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-121): [#def58]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c: scope_hint: In function ‘do_usage’
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:848:7: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:848:7: note: write of 4 bytes to beyond the end of ‘buff’
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:848:7: note: valid subscripts for ‘buff’ are ‘[0]’ to ‘[99]’
# 846| sprintf(buff, " ");
# 847|
# 848|-> sprintf(buff+4, "--%s%s%s", opts[j].name, eq, desc);
# 849| printf("%-55.55s", buff);
# 850|
Error: GCC_ANALYZER_WARNING (CWE-688): [#def59]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c: scope_hint: In function ‘one_opt’
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:2251:11: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
# 2249| case '8': /* --log-facility */
# 2250| /* may be a filename */
# 2251|-> if (strchr(arg, '/') || strcmp (arg, "-") == 0)
# 2252| daemon->log_file = opt_string_alloc(arg);
# 2253| else
Error: GCC_ANALYZER_WARNING (CWE-688): [#def60]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:2349:27: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
/usr/include/features.h:511: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:36: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:19: included_from: Included from here.
/usr/include/stdlib.h:215:17: note: argument 1 of ‘strtol’ must be non-null
# 2347|
# 2348| case LOPT_DUMPMASK: /* --dumpmask */
# 2349|-> daemon->dump_mask = strtol(arg, NULL, 0);
# 2350| break;
# 2351|
Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:2990:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘arg’
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c: scope_hint: In function ‘one_opt’
# 2988| unhide_metas(arg);
# 2989|
# 2990|-> if (*arg == '/')
# 2991| arg++;
# 2992|
Error: CLANG_WARNING: [#def62]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:3062:2: warning[deadcode.DeadStores]: Value stored to 'cur_domain' is never read
# 3060| flags |= SERV_FROM_FILE;
# 3061|
# 3062|-> cur_domain = domain;
# 3063| while ((flags & SERV_LITERAL_ADDRESS) || parse_server_next(&sdetails))
# 3064| {
Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:3692:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cp’
# 3690| while(1)
# 3691| {
# 3692|-> for (cp = arg; *cp; cp++)
# 3693| if (!(*cp == ' ' || *cp == '.' || *cp == ':' ||
# 3694| (*cp >= 'a' && *cp <= 'f') || (*cp >= 'A' && *cp <= 'F') ||
Error: CPPCHECK_WARNING (CWE-457): [#def64]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:5331: error[legacyUninitvar]: Uninitialized variable: keyhex
# 5329|
# 5330| /* Upper bound on length */
# 5331|-> len = (2*strlen(keyhex))+1;
# 5332| new->digest = opt_malloc(len);
# 5333| unhide_metas(keyhex);
Error: GCC_ANALYZER_WARNING (CWE-688): [#def65]
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c: scope_hint: In function ‘one_file’
dnsmasq-2.90-build/dnsmasq-2.90/src/option.c:5552:38: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
/usr/include/sys/un.h:38: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:101: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 5550| }
# 5551|
# 5552|-> if (hard_opt == 0 && !do_popen && strcmp(file, "-") == 0)
# 5553| {
# 5554| if (read_stdin == 1)
Error: CPPCHECK_WARNING: [#def66]
dnsmasq-2.90-build/dnsmasq-2.90/src/pattern.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def67]
dnsmasq-2.90-build/dnsmasq-2.90/src/radv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def68]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc1035.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def69]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc1035.c:546:29: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
# 544| }
# 545|
# 546|-> addr.rrblock.datalen += 20;
# 547|
# 548| if (!no_cache)
Error: CPPCHECK_WARNING: [#def70]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc2131.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def71]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CLANG_WARNING: [#def72]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c:236:9: warning[core.StackAddressEscape]: Address of stack memory associated with local variable 'align' is still referred to by the stack variable 'state' upon returning to the caller. This will be a dangling reference
# 234| {
# 235| if (opt6_ptr(opt, 0) + opt6_len(opt) > end)
# 236|-> return 0;
# 237|
# 238| /* Don't copy MAC address into reply. */
Error: CPPCHECK_WARNING (CWE-562): [#def73]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c:247: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 245| /* the packet data is unaligned, copy to aligned storage */
# 246| memcpy(&align, inbuff + 2, IN6ADDRSZ);
# 247|-> state->link_address = &align;
# 248| /* zero is_unicast since that is now known to refer to the
# 249| relayed packet, not the original sent by the client */
Error: CLANG_WARNING: [#def74]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c:251:3: warning[core.StackAddressEscape]: Address of stack memory associated with local variable 'align' is still referred to by the stack variable 'state' upon returning to the caller. This will be a dangling reference
# 249| relayed packet, not the original sent by the client */
# 250| if (!dhcp6_maybe_relay(state, opt6_ptr(opt, 0), opt6_len(opt), client_addr, 0, now))
# 251|-> return 0;
# 252| }
# 253| else
Error: CLANG_WARNING: [#def75]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c:259:3: warning[core.StackAddressEscape]: Address of stack memory associated with local variable 'align' is still referred to by the stack variable 'state' upon returning to the caller. This will be a dangling reference
# 257| }
# 258|
# 259|-> return 1;
# 260| }
# 261|
Error: CPPCHECK_WARNING (CWE-562): [#def76]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c:297: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 295| v6_id.net = "dhcpv6";
# 296| v6_id.next = state->tags;
# 297|-> state->tags = &v6_id;
# 298|
# 299| start_msg = save_counter(-1);
Error: CPPCHECK_WARNING (CWE-562): [#def77]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c:590: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 588| known_id.net = "known";
# 589| known_id.next = state->tags;
# 590|-> state->tags = &known_id;
# 591|
# 592| if (have_config(config, CONFIG_DISABLE))
Error: CPPCHECK_WARNING (CWE-562): [#def78]
dnsmasq-2.90-build/dnsmasq-2.90/src/rfc3315.c:601: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 599| known_id.net = "known-othernet";
# 600| known_id.next = state->tags;
# 601|-> state->tags = &known_id;
# 602| }
# 603|
Error: CPPCHECK_WARNING: [#def79]
dnsmasq-2.90-build/dnsmasq-2.90/src/rrfilter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def80]
dnsmasq-2.90-build/dnsmasq-2.90/src/slaac.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: CPPCHECK_WARNING: [#def81]
dnsmasq-2.90-build/dnsmasq-2.90/src/tftp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-457): [#def82]
dnsmasq-2.90-build/dnsmasq-2.90/src/tftp.c: scope_hint: In function ‘tftp_request’
dnsmasq-2.90-build/dnsmasq-2.90/src/tftp.c:201:19: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addr.in.sin_addr’
# 199| name = namebuff;
# 200|
# 201|-> addra.addr4 = addr.in.sin_addr;
# 202|
# 203| if (family == AF_INET6)
Error: GCC_ANALYZER_WARNING (CWE-457): [#def83]
dnsmasq-2.90-build/dnsmasq-2.90/src/tftp.c:321:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addra’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:59: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/tftp.c:17: included_from: Included from here.
dnsmasq-2.90-build/dnsmasq-2.90/src/tftp.c: scope_hint: In function ‘tftp_request’
dnsmasq-2.90-build/dnsmasq-2.90/src/dnsmasq.h:291:25: note: in expansion of macro ‘option_var’
dnsmasq-2.90-build/dnsmasq-2.90/src/tftp.c:312:7: note: in expansion of macro ‘option_bool’
# 319|
# 320| transfer->peer = peer;
# 321|-> transfer->source = addra;
# 322| transfer->if_index = if_index;
# 323| transfer->timeout = now + 2;
Error: CPPCHECK_WARNING: [#def84]
dnsmasq-2.90-build/dnsmasq-2.90/src/util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.
Error: GCC_ANALYZER_WARNING (CWE-775): [#def85]
dnsmasq-2.90-build/dnsmasq-2.90/src/util.c: scope_hint: In function ‘rand_init’
dnsmasq-2.90-build/dnsmasq-2.90/src/util.c:772:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/urandom", 0)’
# 770| ssize_t n, done;
# 771|
# 772|-> for (done = 0; done < size; done += n)
# 773| {
# 774| do {
Scan Properties
analyzer-version-clang | 18.1.7 |
analyzer-version-cppcheck | 2.14.2 |
analyzer-version-gcc | 14.1.1 |
analyzer-version-gcc-analyzer | 14.1.1 |
analyzer-version-shellcheck | 0.10.0 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-16.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | dnsmasq-2.90-1.fc41 |
store-results-to | /tmp/tmpugm4opry/dnsmasq-2.90-1.fc41.tar.xz |
time-created | 2024-07-03 12:30:43 |
time-finished | 2024-07-03 12:32:20 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpugm4opry/dnsmasq-2.90-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpugm4opry/dnsmasq-2.90-1.fc41.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |