Error: SHELLCHECK_WARNING (CWE-477): [#def1] /usr/libexec/setup-named-chroot.sh:13:19: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 11| } # 12| # 13|-> if ! [ "$#" -ge 2 -a "$#" -le 3 ]; then # 14| echo 'Wrong number of arguments' # 15| usage Error: SHELLCHECK_WARNING (CWE-88): [#def2] /usr/libexec/setup-named-chroot.sh:37:35: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 35| shift # 36| if ! [ -e "$DEVNAME" ]; then # 37|-> /bin/mknod -m 0664 "$DEVNAME" $@ # 38| /bin/chgrp named "$DEVNAME" # 39| if [ -x /usr/sbin/selinuxenabled -a -x /sbin/restorecon ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def3] /usr/libexec/setup-named-chroot.sh:39:38: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 37| /bin/mknod -m 0664 "$DEVNAME" $@ # 38| /bin/chgrp named "$DEVNAME" # 39|-> if [ -x /usr/sbin/selinuxenabled -a -x /sbin/restorecon ]; then # 40| /usr/sbin/selinuxenabled && /sbin/restorecon "$DEVNAME" > /dev/null || : # 41| fi Error: SHELLCHECK_WARNING (CWE-156): [#def4] /usr/libexec/setup-named-chroot.sh:74:41: warning[SC2046]: Quote this to prevent word splitting. # 72| if ! [ -d "$all" ]; then # 73| # mount it only if it is not present in chroot or it is empty # 74|-> if ! [ -e "$ROOTDIR$all" ] || [ `stat -c'%s' "$ROOTDIR$all"` -eq 0 ]; then # 75| touch "$ROOTDIR$all" # 76| mount --bind "$all" "$ROOTDIR$all" Error: SHELLCHECK_WARNING (CWE-156): [#def5] /usr/libexec/setup-named-chroot.sh:81:31: warning[SC2046]: Quote this to prevent word splitting. # 79| # Mount source is a directory. Mount it only if directory in chroot is # 80| # empty. # 81|-> if [ -e "$all" ] && [ `ls -1A $ROOTDIR$all | wc -l` -eq 0 ]; then # 82| mount --bind --make-private "$all" "$ROOTDIR$all" # 83| fi Error: SHELLCHECK_WARNING (CWE-88): [#def6] /usr/libexec/setup-named-softhsm.sh:26:11: error[SC2068]: Double quote array expansions to avoid re-splitting elements. # 24| echo_i() # 25| { # 26|-> echo "#" $@ # 27| } # 28| Error: SHELLCHECK_WARNING (CWE-477): [#def7] /usr/libexec/setup-named-softhsm.sh:44:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 42| } # 43| # 44|-> if [ "$SOFTHSM2_CONF" = "-A" -a -z "$TOKENPATH" ]; then # 45| TOKENPATH=$(mktemp -d /var/tmp/softhsm-XXXXXX) # 46| fi Error: SHELLCHECK_WARNING (CWE-477): [#def8] /usr/libexec/setup-named-softhsm.sh:48:26: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 46| fi # 47| # 48|-> if [ -z "$SOFTHSM2_CONF" -o -z "$TOKENPATH" ]; then # 49| usage >&2 # 50| exit 1 Error: SHELLCHECK_WARNING (CWE-563): [#def9] /usr/libexec/setup-named-softhsm.sh:61:2: warning[SC2034]: MODE appears unused. Verify use (or export if used externally). # 59| TOKENPATH="$TOKENPATH/tokens" # 60| else # 61|-> MODE=legacy # 62| fi # 63| Error: SHELLCHECK_WARNING: [#def10] /usr/libexec/setup-named-softhsm.sh:106:8: warning[SC3037]: In POSIX sh, echo flags are undefined. # 104| SO_PIN=$(random 18) # 105| if [ -n "$PIN_SOURCE" ]; then # 106|-> echo -n "$PIN" > "$PIN_SOURCE" # 107| echo -n "$SO_PIN" > "$SOPIN_SOURCE" # 108| fi Error: SHELLCHECK_WARNING: [#def11] /usr/libexec/setup-named-softhsm.sh:107:8: warning[SC3037]: In POSIX sh, echo flags are undefined. # 105| if [ -n "$PIN_SOURCE" ]; then # 106| echo -n "$PIN" > "$PIN_SOURCE" # 107|-> echo -n "$SO_PIN" > "$SOPIN_SOURCE" # 108| fi # 109| Error: COMPILER_WARNING (CWE-704): [#def12] bind-9.18.41/bin/delv/delv.c: scope_hint: In function ‘reverse_octets’ bind-9.18.41/bin/delv/delv.c:1661:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type # 1661 | char *dot = strchr(in, '.'); # | ^~~~~~ # 1659| static isc_result_t # 1660| reverse_octets(const char *in, char **p, char *end) { # 1661|-> char *dot = strchr(in, '.'); # 1662| int len; # 1663| if (dot != NULL) { Error: COMPILER_WARNING (CWE-704): [#def13] bind-9.18.41/bin/delv/delv.c:1661:21: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type # 1659| static isc_result_t # 1660| reverse_octets(const char *in, char **p, char *end) { # 1661|-> char *dot = strchr(in, '.'); # 1662| int len; # 1663| if (dot != NULL) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def14] bind-9.18.41/bin/dig/readline.h:47:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ bind-9.18.41/bin/dig/nslookup.c:835:1: enter_function: entry to ‘get_next_command’ bind-9.18.41/bin/dig/nslookup.c:840:12: branch_true: following ‘true’ branch... bind-9.18.41/bin/dig/nslookup.c:841:33: branch_true: ...to here bind-9.18.41/bin/dig/nslookup.c:841:33: call_function: calling ‘readline’ from ‘get_next_command’ # 45| char *line, *buf = malloc(RL_MAXCMD); # 46| fprintf(stdout, "%s", prompt); # 47|-> fflush(stdout); # 48| line = fgets(buf, RL_MAXCMD, stdin); # 49| if (line == NULL) { Error: CPPCHECK_WARNING (CWE-476): [#def15] bind-9.18.41/bin/dig/readline.h:48: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf # 46| fprintf(stdout, "%s", prompt); # 47| fflush(stdout); # 48|-> line = fgets(buf, RL_MAXCMD, stdin); # 49| if (line == NULL) { # 50| free(buf); Error: GCC_ANALYZER_WARNING (CWE-465): [#def16] bind-9.18.41/bin/named/controlconf.c:888:12: warning[-Wanalyzer-deref-before-check]: check of ‘isc__mem_get(mctx, 48, 0)’ for NULL after already dereferencing it bind-9.18.41/bin/named/controlconf.c:830:12: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/controlconf.c:834:9: branch_true: ...to here bind-9.18.41/bin/named/controlconf.c:834:9: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/controlconf.c:835:9: branch_false: ...to here bind-9.18.41/bin/named/controlconf.c:835:9: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/controlconf.c:837:9: branch_false: ...to here bind-9.18.41/bin/named/controlconf.c:837:9: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/controlconf.c:839:17: branch_false: ...to here bind-9.18.41/bin/named/controlconf.c:846:12: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/controlconf.c:847:17: branch_true: ...to here bind-9.18.41/bin/named/controlconf.c:888:12: danger: pointer ‘isc__mem_get(mctx, 48, 0)’ is checked for NULL here but it was already dereferenced at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8) # 886| # 887| cleanup: # 888|-> if (keyid != NULL) { # 889| free_controlkey(keyid, mctx); # 890| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def17] bind-9.18.41/bin/named/dlz_dlopen_driver.c:84:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bind-9.18.41/bin/named/dlz_dlopen_driver.c:83:9: acquire_resource: ‘va_start’ called here bind-9.18.41/bin/named/dlz_dlopen_driver.c:84:9: throw: if ‘isc_log_vwrite’ throws an exception... bind-9.18.41/bin/named/dlz_dlopen_driver.c:84:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 82| va_list ap; # 83| va_start(ap, fmt); # 84|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, # 85| ISC_LOG_DEBUG(level), fmt, ap); # 86| va_end(ap); Error: GCC_ANALYZER_WARNING (CWE-404): [#def18] bind-9.18.41/bin/named/main.c:174:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bind-9.18.41/bin/named/main.c:402:1: enter_function: entry to ‘parse_int’ bind-9.18.41/bin/named/main.c:409:12: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/main.c:410:17: branch_true: ...to here bind-9.18.41/bin/named/main.c:410:17: call_function: calling ‘named_main_earlyfatal’ from ‘parse_int’ # 172| va_start(args, format); # 173| if (named_g_lctx != NULL) { # 174|-> isc_log_vwrite(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, # 175| NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, format, # 176| args); Error: GCC_ANALYZER_WARNING: [#def19] bind-9.18.41/bin/named/os.c:332:31: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘0’ bind-9.18.41/bin/named/os.c:281:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:286:15: branch_false: ...to here bind-9.18.41/bin/named/os.c:287:12: branch_false: following ‘false’ branch (when ‘pid != -1’)... bind-9.18.41/bin/named/os.c:291:12: branch_false: ...to here bind-9.18.41/bin/named/os.c:291:12: branch_false: following ‘false’ branch (when ‘pid == 0’)... bind-9.18.41/bin/named/os.c:308:15: branch_false: ...to here bind-9.18.41/bin/named/os.c:314:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:329:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:329:12: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/os.c:330:20: branch_true: ...to here bind-9.18.41/bin/named/os.c:330:20: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/os.c:331:31: branch_true: ...to here bind-9.18.41/bin/named/os.c:331:31: release_resource: closed here bind-9.18.41/bin/named/os.c:332:31: danger: ‘0’ could be invalid # 330| if (devnullfd != STDIN_FILENO) { # 331| (void)close(STDIN_FILENO); # 332|-> (void)dup2(devnullfd, STDIN_FILENO); # 333| } # 334| if (devnullfd != STDOUT_FILENO) { Error: GCC_ANALYZER_WARNING: [#def20] bind-9.18.41/bin/named/os.c:336:31: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’ bind-9.18.41/bin/named/os.c:281:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:286:15: branch_false: ...to here bind-9.18.41/bin/named/os.c:287:12: branch_false: following ‘false’ branch (when ‘pid != -1’)... bind-9.18.41/bin/named/os.c:291:12: branch_false: ...to here bind-9.18.41/bin/named/os.c:291:12: branch_false: following ‘false’ branch (when ‘pid == 0’)... bind-9.18.41/bin/named/os.c:308:15: branch_false: ...to here bind-9.18.41/bin/named/os.c:314:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:329:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:329:12: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/os.c:330:20: branch_true: ...to here bind-9.18.41/bin/named/os.c:330:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:334:21: branch_false: ...to here bind-9.18.41/bin/named/os.c:334:20: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/os.c:335:31: branch_true: ...to here bind-9.18.41/bin/named/os.c:335:31: release_resource: closed here bind-9.18.41/bin/named/os.c:336:31: danger: ‘1’ could be invalid # 334| if (devnullfd != STDOUT_FILENO) { # 335| (void)close(STDOUT_FILENO); # 336|-> (void)dup2(devnullfd, STDOUT_FILENO); # 337| } # 338| if (devnullfd != STDERR_FILENO && !named_g_keepstderr) { Error: GCC_ANALYZER_WARNING: [#def21] bind-9.18.41/bin/named/os.c:340:31: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’ bind-9.18.41/bin/named/os.c:281:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:286:15: branch_false: ...to here bind-9.18.41/bin/named/os.c:287:12: branch_false: following ‘false’ branch (when ‘pid != -1’)... bind-9.18.41/bin/named/os.c:291:12: branch_false: ...to here bind-9.18.41/bin/named/os.c:291:12: branch_false: following ‘false’ branch (when ‘pid == 0’)... bind-9.18.41/bin/named/os.c:308:15: branch_false: ...to here bind-9.18.41/bin/named/os.c:314:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:329:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:329:12: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/os.c:330:20: branch_true: ...to here bind-9.18.41/bin/named/os.c:330:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:334:21: branch_false: ...to here bind-9.18.41/bin/named/os.c:334:20: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/os.c:335:31: branch_true: ...to here bind-9.18.41/bin/named/os.c:338:20: branch_true: following ‘true’ branch... bind-9.18.41/bin/named/os.c:338:51: branch_true: ...to here bind-9.18.41/bin/named/os.c:338:21: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/os.c:339:31: branch_false: ...to here bind-9.18.41/bin/named/os.c:339:31: release_resource: closed here bind-9.18.41/bin/named/os.c:340:31: danger: ‘2’ could be invalid # 338| if (devnullfd != STDERR_FILENO && !named_g_keepstderr) { # 339| (void)close(STDERR_FILENO); # 340|-> (void)dup2(devnullfd, STDERR_FILENO); # 341| } # 342| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def22] bind-9.18.41/bin/named/os.c:591:33: warning[-Wanalyzer-malloc-leak]: leak of ‘f’ bind-9.18.41/bin/named/os.c:686:1: enter_function: entry to ‘named_os_openfile’ bind-9.18.41/bin/named/os.c:694:13: acquire_memory: allocated here bind-9.18.41/bin/named/os.c:695:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)... bind-9.18.41/bin/named/os.c:701:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:701:13: call_function: calling ‘mkdirpath’ from ‘named_os_openfile’ # 589| if (stat(filename, &sb) == -1) { # 590| if (errno != ENOENT) { # 591|-> strerror_r(errno, strbuf, sizeof(strbuf)); # 592| (*report)("couldn't stat '%s': %s", filename, # 593| strbuf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def23] bind-9.18.41/bin/named/os.c:592:33: warning[-Wanalyzer-malloc-leak]: leak of ‘f’ bind-9.18.41/bin/named/os.c:686:1: enter_function: entry to ‘named_os_openfile’ bind-9.18.41/bin/named/os.c:694:13: acquire_memory: allocated here bind-9.18.41/bin/named/os.c:695:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)... bind-9.18.41/bin/named/os.c:701:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:701:13: call_function: calling ‘mkdirpath’ from ‘named_os_openfile’ # 590| if (errno != ENOENT) { # 591| strerror_r(errno, strbuf, sizeof(strbuf)); # 592|-> (*report)("couldn't stat '%s': %s", filename, # 593| strbuf); # 594| goto error; Error: GCC_ANALYZER_WARNING (CWE-401): [#def24] bind-9.18.41/bin/named/os.c:612:33: warning[-Wanalyzer-malloc-leak]: leak of ‘f’ bind-9.18.41/bin/named/os.c:686:1: enter_function: entry to ‘named_os_openfile’ bind-9.18.41/bin/named/os.c:694:13: acquire_memory: allocated here bind-9.18.41/bin/named/os.c:695:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)... bind-9.18.41/bin/named/os.c:701:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:701:13: call_function: calling ‘mkdirpath’ from ‘named_os_openfile’ # 610| mode |= S_IROTH | S_IXOTH; /* o=rx */ # 611| if (mkdir(filename, mode) == -1) { # 612|-> strerror_r(errno, strbuf, sizeof(strbuf)); # 613| (*report)("couldn't mkdir '%s': %s", filename, # 614| strbuf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def25] bind-9.18.41/bin/named/os.c:613:33: warning[-Wanalyzer-malloc-leak]: leak of ‘f’ bind-9.18.41/bin/named/os.c:686:1: enter_function: entry to ‘named_os_openfile’ bind-9.18.41/bin/named/os.c:694:13: acquire_memory: allocated here bind-9.18.41/bin/named/os.c:695:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)... bind-9.18.41/bin/named/os.c:701:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:701:13: call_function: calling ‘mkdirpath’ from ‘named_os_openfile’ # 611| if (mkdir(filename, mode) == -1) { # 612| strerror_r(errno, strbuf, sizeof(strbuf)); # 613|-> (*report)("couldn't mkdir '%s': %s", filename, # 614| strbuf); # 615| goto error; Error: GCC_ANALYZER_WARNING (CWE-401): [#def26] bind-9.18.41/bin/named/os.c:621:33: warning[-Wanalyzer-malloc-leak]: leak of ‘f’ bind-9.18.41/bin/named/os.c:686:1: enter_function: entry to ‘named_os_openfile’ bind-9.18.41/bin/named/os.c:694:13: acquire_memory: allocated here bind-9.18.41/bin/named/os.c:695:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)... bind-9.18.41/bin/named/os.c:701:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:701:13: call_function: calling ‘mkdirpath’ from ‘named_os_openfile’ # 619| runas_pw->pw_gid) == -1) # 620| { # 621|-> strerror_r(errno, strbuf, sizeof(strbuf)); # 622| (*report)("couldn't chown '%s': %s", filename, # 623| strbuf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def27] bind-9.18.41/bin/named/os.c:622:33: warning[-Wanalyzer-malloc-leak]: leak of ‘f’ bind-9.18.41/bin/named/os.c:686:1: enter_function: entry to ‘named_os_openfile’ bind-9.18.41/bin/named/os.c:694:13: acquire_memory: allocated here bind-9.18.41/bin/named/os.c:695:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)... bind-9.18.41/bin/named/os.c:701:13: branch_false: ...to here bind-9.18.41/bin/named/os.c:701:13: call_function: calling ‘mkdirpath’ from ‘named_os_openfile’ # 620| { # 621| strerror_r(errno, strbuf, sizeof(strbuf)); # 622|-> (*report)("couldn't chown '%s': %s", filename, # 623| strbuf); # 624| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def28] bind-9.18.41/bin/named/server.c:2397:53: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘old’ bind-9.18.41/bin/named/server.c:2520:1: enter_function: entry to ‘configure_rpz’ bind-9.18.41/bin/named/server.c:2542:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2547:19: branch_false: ...to here bind-9.18.41/bin/named/server.c:2577:12: branch_false: following ‘false’ branch (when ‘dnsrps_enabled == 0’)... bind-9.18.41/bin/named/server.c:2605:18: branch_false: ...to here bind-9.18.41/bin/named/server.c:2608:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2612:9: branch_false: ...to here bind-9.18.41/bin/named/server.c:2693:12: branch_true: following ‘true’ branch (when ‘old’ is NULL)... bind-9.18.41/bin/named/server.c:2694:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2699:21: branch_true: following ‘true’ branch (when ‘zone_element’ is non-NULL)... bind-9.18.41/bin/named/server.c:2702:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2702:17: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2703:20: branch_false: ...to here bind-9.18.41/bin/named/server.c:2703:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2706:25: branch_false: ...to here bind-9.18.41/bin/named/server.c:2709:26: call_function: calling ‘configure_rpz_zone’ from ‘configure_rpz’ # 2395| zone->max_policy_ttl = ttl_default; # 2396| } # 2397|-> if (*old_rpz_okp && zone->max_policy_ttl != old->max_policy_ttl) { # 2398| *old_rpz_okp = false; # 2399| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def29] bind-9.18.41/bin/named/server.c:2408:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘old’ bind-9.18.41/bin/named/server.c:2520:1: enter_function: entry to ‘configure_rpz’ bind-9.18.41/bin/named/server.c:2542:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2547:19: branch_false: ...to here bind-9.18.41/bin/named/server.c:2577:12: branch_false: following ‘false’ branch (when ‘dnsrps_enabled == 0’)... bind-9.18.41/bin/named/server.c:2605:18: branch_false: ...to here bind-9.18.41/bin/named/server.c:2608:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2612:9: branch_false: ...to here bind-9.18.41/bin/named/server.c:2693:12: branch_true: following ‘true’ branch (when ‘old’ is NULL)... bind-9.18.41/bin/named/server.c:2694:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2699:21: branch_true: following ‘true’ branch (when ‘zone_element’ is non-NULL)... bind-9.18.41/bin/named/server.c:2702:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2702:17: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2703:20: branch_false: ...to here bind-9.18.41/bin/named/server.c:2703:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2706:25: branch_false: ...to here bind-9.18.41/bin/named/server.c:2709:26: call_function: calling ‘configure_rpz_zone’ from ‘configure_rpz’ # 2406| } # 2407| if (*old_rpz_okp && # 2408|-> zone->min_update_interval != old->min_update_interval) # 2409| { # 2410| *old_rpz_okp = false; Error: GCC_ANALYZER_WARNING (CWE-476): [#def30] bind-9.18.41/bin/named/server.c:2500:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘old’ bind-9.18.41/bin/named/server.c:2520:1: enter_function: entry to ‘configure_rpz’ bind-9.18.41/bin/named/server.c:2542:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2547:19: branch_false: ...to here bind-9.18.41/bin/named/server.c:2577:12: branch_false: following ‘false’ branch (when ‘dnsrps_enabled == 0’)... bind-9.18.41/bin/named/server.c:2605:18: branch_false: ...to here bind-9.18.41/bin/named/server.c:2608:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2612:9: branch_false: ...to here bind-9.18.41/bin/named/server.c:2693:12: branch_true: following ‘true’ branch (when ‘old’ is NULL)... bind-9.18.41/bin/named/server.c:2694:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2699:21: branch_true: following ‘true’ branch (when ‘zone_element’ is non-NULL)... bind-9.18.41/bin/named/server.c:2702:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2702:17: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2703:20: branch_false: ...to here bind-9.18.41/bin/named/server.c:2703:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2706:25: branch_false: ...to here bind-9.18.41/bin/named/server.c:2709:26: call_function: calling ‘configure_rpz_zone’ from ‘configure_rpz’ # 2498| } # 2499| } # 2500|-> if (*old_rpz_okp && (zone->policy != old->policy || # 2501| !dns_name_equal(&old->cname, &zone->cname))) # 2502| { Error: GCC_ANALYZER_WARNING (CWE-476): [#def31] bind-9.18.41/bin/named/server.c:2512:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘old’ bind-9.18.41/bin/named/server.c:2520:1: enter_function: entry to ‘configure_rpz’ bind-9.18.41/bin/named/server.c:2542:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2547:19: branch_false: ...to here bind-9.18.41/bin/named/server.c:2577:12: branch_false: following ‘false’ branch (when ‘dnsrps_enabled == 0’)... bind-9.18.41/bin/named/server.c:2605:18: branch_false: ...to here bind-9.18.41/bin/named/server.c:2608:12: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2612:9: branch_false: ...to here bind-9.18.41/bin/named/server.c:2693:12: branch_true: following ‘true’ branch (when ‘old’ is NULL)... bind-9.18.41/bin/named/server.c:2694:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2699:21: branch_true: following ‘true’ branch (when ‘zone_element’ is non-NULL)... bind-9.18.41/bin/named/server.c:2702:17: branch_true: ...to here bind-9.18.41/bin/named/server.c:2702:17: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2703:20: branch_false: ...to here bind-9.18.41/bin/named/server.c:2703:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/named/server.c:2706:25: branch_false: ...to here bind-9.18.41/bin/named/server.c:2709:26: call_function: calling ‘configure_rpz_zone’ from ‘configure_rpz’ # 2510| zone->addsoa = cfg_obj_asboolean(obj); # 2511| } # 2512|-> if (*old_rpz_okp && zone->addsoa != old->addsoa) { # 2513| *old_rpz_okp = false; # 2514| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def32] bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:279:17: warning[-Wanalyzer-malloc-leak]: leak of 'state' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:255:1: enter_function: entry to 'dlz_create' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:266:17: acquire_memory: allocated here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:267:12: branch_false: following 'false' branch (when 'state' is non-NULL)... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:272:9: branch_false: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:273:16: branch_true: following 'true' branch (when 'helper_name' is non-NULL)... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:274:17: branch_true: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:274:17: call_function: calling 'b9_add_helper' from 'dlz_create' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:274:17: return_function: returning to 'dlz_create' from 'b9_add_helper' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:279:17: branch_true: following 'true' branch... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:279:17: branch_true: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:279:17: throw: if the called function throws an exception... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:279:17: danger: 'state' leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1) # 277| # 278| if (argc < 2 || argv[1][0] == '\0') { # 279|-> logerr("dlz_example: please specify a zone name"); # 280| dlz_destroy(state); # 281| return ISC_R_FAILURE; Error: GCC_ANALYZER_WARNING (CWE-401): [#def33] bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:325:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:255:1: enter_function: entry to 'dlz_create' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:267:12: branch_false: following 'false' branch (when 'state' is non-NULL)... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:272:9: branch_false: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:278:12: branch_false: following 'false' branch... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:285:28: acquire_memory: allocated here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:286:12: branch_false: following 'false' branch... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:290:21: branch_false: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:290:12: branch_true: following 'true' branch... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:291:17: call_function: inlined call to 'strcpy' from 'dlz_create' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:308:12: branch_true: following 'true' branch (when 'n > 40')... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:309:17: branch_true: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:325:9: danger: '<unknown>' leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5) # 323| # 324| failure: # 325|-> free(state); # 326| return result; # 327| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def34] bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:336:9: warning[-Wanalyzer-malloc-leak]: leak of 'state' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:255:1: enter_function: entry to 'dlz_create' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:266:17: acquire_memory: allocated here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:267:12: branch_false: following 'false' branch (when 'state' is non-NULL)... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:272:9: branch_false: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:273:16: branch_true: following 'true' branch (when 'helper_name' is non-NULL)... bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:274:17: branch_true: ...to here bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:274:17: call_function: calling 'b9_add_helper' from 'dlz_create' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:274:17: return_function: returning to 'dlz_create' from 'b9_add_helper' bind-9.18.41/bin/tests/system/dlzexternal/driver/driver.c:280:17: call_function: calling 'dlz_destroy' from 'dlz_create' # 334| struct dlz_example_data *state = (struct dlz_example_data *)dbdata; # 335| # 336|-> loginfo("dlz_example: shutting down zone %s", state->zone_name); # 337| free(state->zone_name); # 338| free(state); Error: GCC_ANALYZER_WARNING (CWE-404): [#def35] bind-9.18.41/bin/tests/system/dyndb/driver/log.c:41:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/bin/tests/system/dyndb/driver/log.c:40:9: acquire_resource: 'va_start' called here bind-9.18.41/bin/tests/system/dyndb/driver/log.c:41:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/bin/tests/system/dyndb/driver/log.c:41:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 39| # 40| va_start(args, format); # 41|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, # 42| level, format, args); # 43| va_end(args); Error: GCC_ANALYZER_WARNING (CWE-404): [#def36] bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:109:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:108:9: acquire_resource: 'va_start' called here bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:109:9: throw: if 'isc_log_write' throws an exception... bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:109:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 107| # 108| va_start(ap, fmt); # 109|-> isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, # 110| ISC_LOG_INFO, fmt, ap); # 111| va_end(ap); Error: GCC_ANALYZER_WARNING (CWE-476): [#def37] bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:319:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '0' bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:309:1: enter_function: entry to 'async_query_done_begin' bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:312:26: call_function: calling 'client_state_get' from 'async_query_done_begin' bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:312:26: return_function: returning to 'async_query_done_begin' from 'client_state_get' bind-9.18.41/bin/tests/system/hooks/driver/test-async.c:319:13: danger: dereference of NULL 'client_state_get(arg, cbdata)' # 317| # 318| logmsg("done begin hook"); # 319|-> if (state->async) { # 320| /* resuming */ # 321| state->async = false; Error: GCC_ANALYZER_WARNING (CWE-775): [#def38] bind-9.18.41/bin/tests/wire_test.c:185:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’ bind-9.18.41/bin/tests/wire_test.c:174:12: branch_true: following ‘true’ branch (when ‘argc > 0’)... bind-9.18.41/bin/tests/wire_test.c:175:21: branch_true: ...to here bind-9.18.41/bin/tests/wire_test.c:175:21: acquire_resource: opened here bind-9.18.41/bin/tests/wire_test.c:176:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/tests/wire_test.c:185:9: branch_false: ...to here bind-9.18.41/bin/tests/wire_test.c:185:9: throw: if ‘isc_buffer_allocate’ throws an exception... bind-9.18.41/bin/tests/wire_test.c:185:9: danger: ‘f’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 183| } # 184| # 185|-> isc_buffer_allocate(mctx, &input, 64 * 1024); # 186| # 187| if (rawdata) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def39] bind-9.18.41/bin/tests/wire_test.c:185:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’ bind-9.18.41/bin/tests/wire_test.c:174:12: branch_true: following ‘true’ branch (when ‘argc > 0’)... bind-9.18.41/bin/tests/wire_test.c:175:21: branch_true: ...to here bind-9.18.41/bin/tests/wire_test.c:175:21: acquire_memory: allocated here bind-9.18.41/bin/tests/wire_test.c:176:20: branch_false: following ‘false’ branch... bind-9.18.41/bin/tests/wire_test.c:185:9: branch_false: ...to here bind-9.18.41/bin/tests/wire_test.c:185:9: throw: if ‘isc_buffer_allocate’ throws an exception... bind-9.18.41/bin/tests/wire_test.c:185:9: danger: ‘f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) # 183| } # 184| # 185|-> isc_buffer_allocate(mctx, &input, 64 * 1024); # 186| # 187| if (rawdata) { Error: COMPILER_WARNING (CWE-704): [#def40] bind-9.18.41/bin/tools/mdig.c: scope_hint: In function ‘dash_option’ bind-9.18.41/bin/tools/mdig.c:1741:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 1741 | hash = strchr(value, '#'); # | ^ # 1739| case 'b': # 1740| GLOBAL(); # 1741|-> hash = strchr(value, '#'); # 1742| if (hash != NULL) { # 1743| result = parse_uint(&num, hash + 1, MAXPORT, Error: COMPILER_WARNING (CWE-704): [#def41] bind-9.18.41/bin/tools/mdig.c:1741:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 1739| case 'b': # 1740| GLOBAL(); # 1741|-> hash = strchr(value, '#'); # 1742| if (hash != NULL) { # 1743| result = parse_uint(&num, hash + 1, MAXPORT, Error: CPPCHECK_WARNING (CWE-758): [#def42] bind-9.18.41/lib/dns/adb.c:388: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 386| */ # 387| enum { # 388|-> FIND_EVENT_SENT = 1 << 31, # 389| FIND_EVENT_FREED = 1 << 30, # 390| }; Error: CPPCHECK_WARNING (CWE-758): [#def43] bind-9.18.41/lib/dns/adb.c:398: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 396| */ # 397| enum { # 398|-> NAME_IS_DEAD = 1 << 31, # 399| NAME_NEEDS_POKE = 1 << 30, # 400| }; Error: CPPCHECK_WARNING (CWE-758): [#def44] bind-9.18.41/lib/dns/adb.c:416: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour # 414| */ # 415| enum { # 416|-> ENTRY_IS_DEAD = 1 << 31, # 417| }; # 418| Error: GCC_ANALYZER_WARNING (CWE-404): [#def45] bind-9.18.41/lib/dns/adb.c:521:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/adb.c:520:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/adb.c:521:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/lib/dns/adb.c:521:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 519| # 520| va_start(args, format); # 521|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ADB, # 522| level, format, args); # 523| va_end(args); Error: CPPCHECK_WARNING (CWE-457): [#def46] bind-9.18.41/lib/dns/adb.c:960: error[uninitvar]: Uninitialized variable: &in6a # 958| INSIST(rdata.length == 16); # 959| memmove(in6a.s6_addr, rdata.data, 16); # 960|-> isc_sockaddr_fromin6(&sockaddr, &in6a, 0); # 961| hookhead = &adbname->v6; # 962| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def47] bind-9.18.41/lib/dns/callbacks.c:58:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/callbacks.c:57:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/callbacks.c:58:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/lib/dns/callbacks.c:58:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 56| # 57| va_start(ap, fmt); # 58|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, # 59| DNS_LOGMODULE_MASTER, /* XXX */ # 60| ISC_LOG_ERROR, fmt, ap); Error: GCC_ANALYZER_WARNING (CWE-404): [#def48] bind-9.18.41/lib/dns/callbacks.c:72:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/callbacks.c:70:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/callbacks.c:72:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/lib/dns/callbacks.c:72:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 70| va_start(ap, fmt); # 71| # 72|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, # 73| DNS_LOGMODULE_MASTER, /* XXX */ # 74| ISC_LOG_WARNING, fmt, ap); Error: GCC_ANALYZER_WARNING (CWE-401): [#def49] bind-9.18.41/lib/dns/dnstap.c:543:15: warning[-Wanalyzer-malloc-leak]: leak of 'sbuf.data' bind-9.18.41/lib/dns/dnstap.c:525:1: enter_function: entry to 'pack_dt' bind-9.18.41/lib/dns/dnstap.c:528:9: branch_true: following 'true' branch (when 'd' is non-NULL)... bind-9.18.41/lib/dns/dnstap.c:529:9: branch_true: ...to here bind-9.18.41/lib/dns/dnstap.c:529:9: branch_true: following 'true' branch (when 'sz' is non-NULL)... bind-9.18.41/lib/dns/dnstap.c:531:9: call_function: inlined call to 'memset' from 'pack_dt' bind-9.18.41/lib/dns/dnstap.c:537:21: acquire_memory: allocated here bind-9.18.41/lib/dns/dnstap.c:538:12: branch_false: following 'false' branch... bind-9.18.41/lib/dns/dnstap.c:541:9: branch_false: ...to here bind-9.18.41/lib/dns/dnstap.c:543:15: throw: if 'dnstap__dnstap__pack_to_buffer' throws an exception... bind-9.18.41/lib/dns/dnstap.c:543:15: danger: 'sbuf.data' leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6) # 541| sbuf.must_free_data = 1; # 542| # 543|-> *sz = dnstap__dnstap__pack_to_buffer(d, (ProtobufCBuffer *)&sbuf); # 544| if (sbuf.data == NULL) { # 545| return ISC_R_FAILURE; Error: GCC_ANALYZER_WARNING (CWE-465): [#def50] bind-9.18.41/lib/dns/dst_api.c:327:12: warning[-Wanalyzer-deref-before-check]: check of '**dctxp.key' for NULL after already dereferencing it bind-9.18.41/lib/dns/dst_api.c:321:9: branch_true: following 'true' branch... bind-9.18.41/lib/dns/dst_api.c:325:9: branch_true: following 'true' branch... bind-9.18.41/lib/dns/dst_api.c:326:9: branch_true: ...to here bind-9.18.41/lib/dns/dst_api.c:327:12: danger: pointer '**dctxp.key' is checked for NULL here but it was already dereferenced at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 325| INSIST(dctx->key->func->destroyctx != NULL); # 326| dctx->key->func->destroyctx(dctx); # 327|-> if (dctx->key != NULL) { # 328| dst_key_free(&dctx->key); # 329| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def51] bind-9.18.41/lib/dns/gssapictx.c:959:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/gssapictx.c:958:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/gssapictx.c:959:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/lib/dns/gssapictx.c:959:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 957| # 958| va_start(ap, fmt); # 959|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_TKEY, # 960| ISC_LOG_DEBUG(level), fmt, ap); # 961| va_end(ap); Error: GCC_ANALYZER_WARNING (CWE-476): [#def52] bind-9.18.41/lib/dns/rbtdb.c:3131:14: warning[-Wanalyzer-null-dereference]: dereference of NULL 'header' bind-9.18.41/lib/dns/rbtdb.c:10045:1: enter_function: entry to 'glue_nsdname_cb' bind-9.18.41/lib/dns/rbtdb.c:10065:9: branch_true: following 'true' branch (when 'qtype == 1')... bind-9.18.41/lib/dns/rbtdb.c:10069:18: branch_true: ...to here bind-9.18.41/lib/dns/rbtdb.c:10077:18: call_function: calling 'zone_find' from 'glue_nsdname_cb' # 3129| * Mark header stale or ancient if the RRset is no longer active. # 3130| */ # 3131|-> if (!ACTIVE(header, now)) { # 3132| dns_ttl_t stale_ttl = header->rdh_ttl + # 3133| STALE_TTL(header, rbtdb); Error: CPPCHECK_WARNING (CWE-476): [#def53] bind-9.18.41/lib/dns/rbtdb.c:3751: warning[nullPointer]: Possible null pointer dereference: firstp # 3749| # 3750| for (;;) { # 3751|-> if (*firstp) { # 3752| /* # 3753| * Construct the name of the second node to check. Error: CPPCHECK_WARNING (CWE-457): [#def54] bind-9.18.41/lib/dns/rdata.c:557: error[uninitvar]: Uninitialized variable: len # 555| unsigned int i; # 556| # 557|-> for (i = 0; i < sr->length; i += len) { # 558| /* # 559| * Check for overflow. Error: GCC_ANALYZER_WARNING (CWE-404): [#def55] bind-9.18.41/lib/dns/request.c:1244:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/request.c:1243:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/request.c:1244:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/lib/dns/request.c:1244:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 1242| # 1243| va_start(ap, fmt); # 1244|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST, # 1245| level, fmt, ap); # 1246| va_end(ap); Error: CPPCHECK_WARNING (CWE-457): [#def56] bind-9.18.41/lib/dns/resolver.c:7380: error[uninitvar]: Uninitialized variable: &in6a # 7378| INSIST(rdata.length == sizeof(in6a.s6_addr)); # 7379| memmove(in6a.s6_addr, rdata.data, sizeof(in6a.s6_addr)); # 7380|-> isc_netaddr_fromin6(&netaddr, &in6a); # 7381| } # 7382| Error: CPPCHECK_WARNING (CWE-190): [#def57] bind-9.18.41/lib/dns/resolver.c:10668: error[integerOverflow]: Signed integer overflow for expression '-2-1'. #10666| */ #10667| result = isc_task_create_bound( #10668|-> taskmgr, 0, &res->buckets[i].task, ISC_NM_TASK_SLOW(i)); #10669| if (result != ISC_R_SUCCESS) { #10670| ntasks = i; Error: GCC_ANALYZER_WARNING (CWE-404): [#def58] bind-9.18.41/lib/dns/sdlz.c:236:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/sdlz.c:2074:1: enter_function: entry to 'dns_sdlzunregister' bind-9.18.41/lib/dns/sdlz.c:2078:9: call_function: calling 'sdlz_log' from 'dns_sdlzunregister' # 234| va_list ap; # 235| va_start(ap, fmt); # 236|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DLZ, # 237| ISC_LOG_DEBUG(level), fmt, ap); # 238| va_end(ap); Error: GCC_ANALYZER_WARNING (CWE-404): [#def59] bind-9.18.41/lib/dns/ssu_external.c:49:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/ssu_external.c:48:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/ssu_external.c:49:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/lib/dns/ssu_external.c:49:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 47| # 48| va_start(ap, fmt); # 49|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_SECURITY, DNS_LOGMODULE_ZONE, # 50| ISC_LOG_DEBUG(level), fmt, ap); # 51| va_end(ap); Error: GCC_ANALYZER_WARNING (CWE-775): [#def60] bind-9.18.41/lib/dns/ssu_external.c:85:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'fd' bind-9.18.41/lib/dns/ssu_external.c:58:1: enter_function: entry to 'ux_socket_connect' bind-9.18.41/lib/dns/ssu_external.c:62:9: branch_true: following 'true' branch (when 'path' is non-NULL)... bind-9.18.41/lib/dns/ssu_external.c:64:13: branch_true: ...to here bind-9.18.41/lib/dns/ssu_external.c:64:12: branch_false: following 'false' branch... bind-9.18.41/lib/dns/ssu_external.c:72:9: call_function: inlined call to 'memset' from 'ux_socket_connect' bind-9.18.41/lib/dns/ssu_external.c:76:14: acquire_resource: stream socket created here bind-9.18.41/lib/dns/ssu_external.c:77:12: branch_false: following 'false' branch (when 'fd != -1')... bind-9.18.41/lib/dns/ssu_external.c:85:13: branch_false: ...to here bind-9.18.41/lib/dns/ssu_external.c:85:13: throw: if 'connect' throws an exception... bind-9.18.41/lib/dns/ssu_external.c:85:13: danger: 'fd' leaks here # 83| } # 84| # 85|-> if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { # 86| char strbuf[ISC_STRERRORSIZE]; # 87| strerror_r(errno, strbuf, sizeof(strbuf)); Error: GCC_ANALYZER_WARNING (CWE-404): [#def61] bind-9.18.41/lib/dns/tkey.c:72:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/tkey.c:71:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/tkey.c:72:9: throw: if 'isc_log_vwrite' throws an exception... bind-9.18.41/lib/dns/tkey.c:72:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 70| # 71| va_start(ap, fmt); # 72|-> isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_REQUEST, # 73| ISC_LOG_DEBUG(4), fmt, ap); # 74| va_end(ap); Error: GCC_ANALYZER_WARNING (CWE-775): [#def62] bind-9.18.41/lib/dns/view.c:978:33: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(&keyfile, "r")' bind-9.18.41/lib/dns/view.c:970:9: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:972:12: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:973:50: branch_true: ...to here bind-9.18.41/lib/dns/view.c:975:20: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:976:30: branch_true: ...to here bind-9.18.41/lib/dns/view.c:976:30: acquire_resource: opened here bind-9.18.41/lib/dns/view.c:977:28: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:978:33: branch_true: ...to here bind-9.18.41/lib/dns/view.c:978:33: throw: if 'dns_keyring_restore' throws an exception... bind-9.18.41/lib/dns/view.c:978:33: danger: 'fopen(&keyfile, "r")' leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6) # 976| fp = fopen(keyfile, "r"); # 977| if (fp != NULL) { # 978|-> dns_keyring_restore(view->dynamickeys, fp); # 979| (void)fclose(fp); # 980| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def63] bind-9.18.41/lib/dns/view.c:978:33: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(&keyfile, "r")' bind-9.18.41/lib/dns/view.c:970:9: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:972:12: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:973:50: branch_true: ...to here bind-9.18.41/lib/dns/view.c:975:20: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:976:30: branch_true: ...to here bind-9.18.41/lib/dns/view.c:976:30: acquire_memory: allocated here bind-9.18.41/lib/dns/view.c:977:28: branch_true: following 'true' branch... bind-9.18.41/lib/dns/view.c:978:33: branch_true: ...to here bind-9.18.41/lib/dns/view.c:978:33: throw: if 'dns_keyring_restore' throws an exception... bind-9.18.41/lib/dns/view.c:978:33: danger: 'fopen(&keyfile, "r")' leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6) # 976| fp = fopen(keyfile, "r"); # 977| if (fp != NULL) { # 978|-> dns_keyring_restore(view->dynamickeys, fp); # 979| (void)fclose(fp); # 980| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def64] bind-9.18.41/lib/dns/xfrin.c:1766:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/xfrin.c:1779:1: enter_function: entry to 'xfrin_log1' bind-9.18.41/lib/dns/xfrin.c:1783:12: branch_true: following 'true' branch... bind-9.18.41/lib/dns/xfrin.c:1787:9: branch_true: ...to here bind-9.18.41/lib/dns/xfrin.c:1787:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/dns/xfrin.c:1788:9: call_function: calling 'xfrin_logv' from 'xfrin_log1' # 1764| char msgtext[2048]; # 1765| # 1766|-> isc_sockaddr_format(primaryaddr, primarytext, sizeof(primarytext)); # 1767| vsnprintf(msgtext, sizeof(msgtext), fmt, ap); # 1768| Error: GCC_ANALYZER_WARNING (CWE-404): [#def65] bind-9.18.41/lib/dns/zoneverify.c:120:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/dns/zoneverify.c:1342:1: enter_function: entry to 'check_apex_rrsets' bind-9.18.41/lib/dns/zoneverify.c:1347:12: branch_true: following 'true' branch... bind-9.18.41/lib/dns/zoneverify.c:1348:17: branch_true: ...to here bind-9.18.41/lib/dns/zoneverify.c:1348:17: call_function: calling 'zoneverify_log_error' from 'check_apex_rrsets' # 118| va_start(ap, fmt); # 119| if (vctx->zone != NULL) { # 120|-> dns_zone_logv(vctx->zone, DNS_LOGCATEGORY_GENERAL, # 121| ISC_LOG_ERROR, NULL, fmt, ap); # 122| } else { Error: GCC_ANALYZER_WARNING (CWE-457): [#def66] bind-9.18.41/lib/isc/base32.c:209:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*ctx.val[1]' bind-9.18.41/lib/isc/base32.c:406:1: enter_function: entry to 'isc_base32hex_decoderegion' bind-9.18.41/lib/isc/base32.c:407:16: call_function: calling 'base32_decoderegion' from 'isc_base32hex_decoderegion' # 207| return ISC_R_BADBASE32; # 208| case 2: # 209|-> if ((ctx->val[1] & 0x03) != 0) { # 210| return ISC_R_BADBASE32; # 211| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def67] bind-9.18.41/lib/isc/base32.c:217:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*ctx.val[3]' bind-9.18.41/lib/isc/base32.c:406:1: enter_function: entry to 'isc_base32hex_decoderegion' bind-9.18.41/lib/isc/base32.c:407:16: call_function: calling 'base32_decoderegion' from 'isc_base32hex_decoderegion' # 215| return ISC_R_BADBASE32; # 216| case 4: # 217|-> if ((ctx->val[3] & 0x0f) != 0) { # 218| return ISC_R_BADBASE32; # 219| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def68] bind-9.18.41/lib/isc/base32.c:223:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*ctx.val[4]' bind-9.18.41/lib/isc/base32.c:406:1: enter_function: entry to 'isc_base32hex_decoderegion' bind-9.18.41/lib/isc/base32.c:407:16: call_function: calling 'base32_decoderegion' from 'isc_base32hex_decoderegion' # 221| break; # 222| case 5: # 223|-> if ((ctx->val[4] & 0x01) != 0) { # 224| return ISC_R_BADBASE32; # 225| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def69] bind-9.18.41/lib/isc/base32.c:231:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*ctx.val[6]' bind-9.18.41/lib/isc/base32.c:406:1: enter_function: entry to 'isc_base32hex_decoderegion' bind-9.18.41/lib/isc/base32.c:407:16: call_function: calling 'base32_decoderegion' from 'isc_base32hex_decoderegion' # 229| return ISC_R_BADBASE32; # 230| case 7: # 231|-> if ((ctx->val[6] & 0x07) != 0) { # 232| return ISC_R_BADBASE32; # 233| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def70] bind-9.18.41/lib/isc/error.c:60:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/isc/error.c:59:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/isc/error.c:60:9: throw: if the called function throws an exception... bind-9.18.41/lib/isc/error.c:60:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 58| # 59| va_start(args, format); # 60|-> (unexpected_callback)(file, line, func, format, args); # 61| va_end(args); # 62| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def71] bind-9.18.41/lib/isc/error.c:70:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/isc/error.c:69:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/isc/error.c:70:9: throw: if the called function throws an exception... bind-9.18.41/lib/isc/error.c:70:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 68| # 69| va_start(args, format); # 70|-> (fatal_callback)(file, line, func, format, args); # 71| va_end(args); # 72| abort(); Error: COMPILER_WARNING (CWE-704): [#def72] bind-9.18.41/lib/isc/file.c: scope_hint: In function 'isc_file_openuniquemode' bind-9.18.41/lib/isc/file.c:361:27: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 361 | t = strchr(alphnum, *cp); # | ^ # 359| return ISC_R_FAILURE; # 360| } # 361|-> t = strchr(alphnum, *cp); # 362| if (t == NULL || *++t == '\0') { # 363| *cp++ = alphnum[0]; Error: COMPILER_WARNING (CWE-704): [#def73] bind-9.18.41/lib/isc/file.c:361:27: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type # 359| return ISC_R_FAILURE; # 360| } # 361|-> t = strchr(alphnum, *cp); # 362| if (t == NULL || *++t == '\0') { # 363| *cp++ = alphnum[0]; Error: CPPCHECK_WARNING (CWE-457): [#def74] bind-9.18.41/lib/isc/hash.c:121: warning[uninitvar]: Uninitialized variable: input # 119| input[i] = maptolower[((const uint8_t *)data)[i]]; # 120| } # 121|-> isc_siphash24(isc_hash_key, input, length, (uint8_t *)&hval); # 122| } # 123| Error: CPPCHECK_WARNING (CWE-457): [#def75] bind-9.18.41/lib/isc/hash.c:144: warning[uninitvar]: Uninitialized variable: input # 142| input[i] = maptolower[((const uint8_t *)data)[i]]; # 143| } # 144|-> isc_halfsiphash24(isc_hash_key, input, length, # 145| (uint8_t *)&hval); # 146| } Error: CPPCHECK_WARNING (CWE-476): [#def76] bind-9.18.41/lib/isc/jemalloc_shim.h:46: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: si # 44| INSIST(si != NULL); # 45| # 46|-> si->size = size; # 47| ptr = &si[1]; # 48| Error: CPPCHECK_WARNING (CWE-590): [#def77] bind-9.18.41/lib/isc/jemalloc_shim.h:56: error[autovarInvalidDeallocation]: Deallocation of an auto-variable ([) results in undefined behaviour. # 54| size_info *si = &(((size_info *)ptr)[-1]); # 55| # 56|-> free(si); # 57| } # 58| Error: CPPCHECK_WARNING (CWE-401): [#def78] bind-9.18.41/lib/isc/jemalloc_shim.h:72: error[memleakOnRealloc]: Common realloc mistake: 'si' nulled but not freed upon failure # 70| UNUSED(flags); # 71| # 72|-> si = realloc(si, size + sizeof(*si)); # 73| INSIST(si != NULL); # 74| Error: GCC_ANALYZER_WARNING (CWE-401): [#def79] bind-9.18.41/lib/isc/mem.c:526:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:509:1: enter_function: entry to 'mem_create' bind-9.18.41/lib/isc/mem.c:512:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:514:15: call_function: calling 'mallocx' from 'mem_create' bind-9.18.41/lib/isc/mem.c:514:15: return_function: returning to 'mem_create' from 'mallocx' bind-9.18.41/lib/isc/mem.c:526:9: throw: if 'isc__mutex_init' throws an exception... bind-9.18.41/lib/isc/mem.c:526:9: danger: '<unknown>' leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5) # 524| }; # 525| # 526|-> isc_mutex_init(&ctx->lock); # 527| isc_refcount_init(&ctx->references, 1); # 528| Error: GCC_ANALYZER_WARNING (CWE-401): [#def80] bind-9.18.41/lib/isc/mem.c:651:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:1226:1: enter_function: entry to 'isc__mempool_create' bind-9.18.41/lib/isc/mem.c:1231:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1232:9: branch_true: following 'true' branch (when 'element_size != 0')... bind-9.18.41/lib/isc/mem.c:1233:9: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:1233:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1246:17: call_function: calling 'isc__mem_get' from 'isc__mempool_create' bind-9.18.41/lib/isc/mem.c:1246:17: return_function: returning to 'isc__mempool_create' from 'isc__mem_get' bind-9.18.41/lib/isc/mem.c:1261:9: call_function: calling 'isc_mem_attach' from 'isc__mempool_create' # 649| void # 650| isc_mem_attach(isc_mem_t *source, isc_mem_t **targetp) { # 651|-> REQUIRE(VALID_CONTEXT(source)); # 652| REQUIRE(targetp != NULL && *targetp == NULL); # 653| Error: GCC_ANALYZER_WARNING (CWE-401): [#def81] bind-9.18.41/lib/isc/mem.c:654:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:1226:1: enter_function: entry to 'isc__mempool_create' bind-9.18.41/lib/isc/mem.c:1231:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1232:9: branch_true: following 'true' branch (when 'element_size != 0')... bind-9.18.41/lib/isc/mem.c:1233:9: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:1233:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1246:17: call_function: calling 'isc__mem_get' from 'isc__mempool_create' bind-9.18.41/lib/isc/mem.c:1246:17: return_function: returning to 'isc__mempool_create' from 'isc__mem_get' bind-9.18.41/lib/isc/mem.c:1261:9: call_function: calling 'isc_mem_attach' from 'isc__mempool_create' # 652| REQUIRE(targetp != NULL && *targetp == NULL); # 653| # 654|-> isc_refcount_increment(&source->references); # 655| # 656| *targetp = source; Error: GCC_ANALYZER_WARNING (CWE-401): [#def82] bind-9.18.41/lib/isc/mem.c:830:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:820:1: enter_function: entry to 'isc__mem_get' bind-9.18.41/lib/isc/mem.c:823:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:825:15: call_function: calling 'mem_get' from 'isc__mem_get' bind-9.18.41/lib/isc/mem.c:825:15: return_function: returning to 'isc__mem_get' from 'mem_get' bind-9.18.41/lib/isc/mem.c:830:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:830:9: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:830:9: call_function: calling 'hi_water' from 'isc__mem_get' bind-9.18.41/lib/isc/mem.c:830:9: return_function: returning to 'isc__mem_get' from 'hi_water' bind-9.18.41/lib/isc/mem.c:830:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:830:9: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:830:9: throw: if the called function throws an exception... bind-9.18.41/lib/isc/mem.c:830:9: danger: '<unknown>' leaks here; was allocated at [(8)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/7) # 828| ADD_TRACE(ctx, ptr, size, file, line); # 829| # 830|-> CALL_HI_WATER(ctx); # 831| # 832| return ptr; Error: GCC_ANALYZER_WARNING (CWE-401): [#def83] bind-9.18.41/lib/isc/mem.c:967:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:954:1: enter_function: entry to 'isc__mem_allocate' bind-9.18.41/lib/isc/mem.c:957:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:959:15: call_function: calling 'mem_get' from 'isc__mem_allocate' bind-9.18.41/lib/isc/mem.c:959:15: return_function: returning to 'isc__mem_allocate' from 'mem_get' bind-9.18.41/lib/isc/mem.c:967:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:967:9: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:967:9: call_function: calling 'hi_water' from 'isc__mem_allocate' bind-9.18.41/lib/isc/mem.c:967:9: return_function: returning to 'isc__mem_allocate' from 'hi_water' bind-9.18.41/lib/isc/mem.c:967:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:967:9: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:967:9: throw: if the called function throws an exception... bind-9.18.41/lib/isc/mem.c:967:9: danger: '<unknown>' leaks here; was allocated at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7) # 965| ADD_TRACE(ctx, ptr, size, file, line); # 966| # 967|-> CALL_HI_WATER(ctx); # 968| # 969| return ptr; Error: GCC_ANALYZER_WARNING (CWE-401): [#def84] bind-9.18.41/lib/isc/mem.c:997:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:973:1: enter_function: entry to 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:977:12: branch_false: following 'false' branch (when 'old_ptr' is non-NULL)... bind-9.18.41/lib/isc/mem.c:980:19: branch_false: ...to here bind-9.18.41/lib/isc/mem.c:980:19: branch_false: following 'false' branch (when 'new_size != 0')... bind-9.18.41/lib/isc/mem.c:984:17: branch_false: ...to here bind-9.18.41/lib/isc/mem.c:984:17: call_function: calling 'mem_putstats' from 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:984:17: return_function: returning to 'isc__mem_reget' from 'mem_putstats' bind-9.18.41/lib/isc/mem.c:986:27: call_function: calling 'mem_realloc' from 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:986:27: return_function: returning to 'isc__mem_reget' from 'mem_realloc' bind-9.18.41/lib/isc/mem.c:997:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:997:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:997:17: call_function: calling 'lo_water' from 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:997:17: return_function: returning to 'isc__mem_reget' from 'lo_water' bind-9.18.41/lib/isc/mem.c:997:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:997:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:997:17: throw: if the called function throws an exception... bind-9.18.41/lib/isc/mem.c:997:17: danger: '<unknown>' leaks here; was allocated at [(20)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/19) # 995| * the water and we would call water twice. # 996| */ # 997|-> CALL_LO_WATER(ctx); # 998| CALL_HI_WATER(ctx); # 999| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def85] bind-9.18.41/lib/isc/mem.c:998:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:973:1: enter_function: entry to 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:977:12: branch_false: following 'false' branch (when 'old_ptr' is non-NULL)... bind-9.18.41/lib/isc/mem.c:980:19: branch_false: ...to here bind-9.18.41/lib/isc/mem.c:980:19: branch_false: following 'false' branch (when 'new_size != 0')... bind-9.18.41/lib/isc/mem.c:984:17: branch_false: ...to here bind-9.18.41/lib/isc/mem.c:984:17: call_function: calling 'mem_putstats' from 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:984:17: return_function: returning to 'isc__mem_reget' from 'mem_putstats' bind-9.18.41/lib/isc/mem.c:986:27: call_function: calling 'mem_realloc' from 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:986:27: return_function: returning to 'isc__mem_reget' from 'mem_realloc' bind-9.18.41/lib/isc/mem.c:998:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:998:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:998:17: call_function: calling 'hi_water' from 'isc__mem_reget' bind-9.18.41/lib/isc/mem.c:998:17: return_function: returning to 'isc__mem_reget' from 'hi_water' bind-9.18.41/lib/isc/mem.c:998:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:998:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:998:17: throw: if the called function throws an exception... bind-9.18.41/lib/isc/mem.c:998:17: danger: '<unknown>' leaks here; was allocated at [(20)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/19) # 996| */ # 997| CALL_LO_WATER(ctx); # 998|-> CALL_HI_WATER(ctx); # 999| } # 1000| Error: GCC_ANALYZER_WARNING (CWE-401): [#def86] bind-9.18.41/lib/isc/mem.c:1033:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:1005:1: enter_function: entry to 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1008:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1010:12: branch_false: following 'false' branch (when 'old_ptr' is non-NULL)... bind-9.18.41/lib/isc/mem.c:1012:19: branch_false: ...to here bind-9.18.41/lib/isc/mem.c:1012:19: branch_false: following 'false' branch (when 'new_size != 0')... bind-9.18.41/lib/isc/mem.c:1015:35: call_function: inlined call to 'sallocx' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1018:17: call_function: calling 'mem_putstats' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1018:17: return_function: returning to 'isc__mem_reallocate' from 'mem_putstats' bind-9.18.41/lib/isc/mem.c:1020:27: call_function: calling 'mem_realloc' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1020:27: return_function: returning to 'isc__mem_reallocate' from 'mem_realloc' bind-9.18.41/lib/isc/mem.c:1033:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1033:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:1033:17: call_function: calling 'lo_water' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1033:17: return_function: returning to 'isc__mem_reallocate' from 'lo_water' bind-9.18.41/lib/isc/mem.c:1033:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1033:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:1033:17: throw: if the called function throws an exception... bind-9.18.41/lib/isc/mem.c:1033:17: danger: '<unknown>' leaks here; was allocated at [(23)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/22) # 1031| * the water and we would call water twice. # 1032| */ # 1033|-> CALL_LO_WATER(ctx); # 1034| CALL_HI_WATER(ctx); # 1035| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def87] bind-9.18.41/lib/isc/mem.c:1034:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>' bind-9.18.41/lib/isc/mem.c:1005:1: enter_function: entry to 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1008:9: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1010:12: branch_false: following 'false' branch (when 'old_ptr' is non-NULL)... bind-9.18.41/lib/isc/mem.c:1012:19: branch_false: ...to here bind-9.18.41/lib/isc/mem.c:1012:19: branch_false: following 'false' branch (when 'new_size != 0')... bind-9.18.41/lib/isc/mem.c:1015:35: call_function: inlined call to 'sallocx' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1018:17: call_function: calling 'mem_putstats' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1018:17: return_function: returning to 'isc__mem_reallocate' from 'mem_putstats' bind-9.18.41/lib/isc/mem.c:1020:27: call_function: calling 'mem_realloc' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1020:27: return_function: returning to 'isc__mem_reallocate' from 'mem_realloc' bind-9.18.41/lib/isc/mem.c:1034:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1034:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:1034:17: call_function: calling 'hi_water' from 'isc__mem_reallocate' bind-9.18.41/lib/isc/mem.c:1034:17: return_function: returning to 'isc__mem_reallocate' from 'hi_water' bind-9.18.41/lib/isc/mem.c:1034:17: branch_true: following 'true' branch... bind-9.18.41/lib/isc/mem.c:1034:17: branch_true: ...to here bind-9.18.41/lib/isc/mem.c:1034:17: throw: if the called function throws an exception... bind-9.18.41/lib/isc/mem.c:1034:17: danger: '<unknown>' leaks here; was allocated at [(23)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/22) # 1032| */ # 1033| CALL_LO_WATER(ctx); # 1034|-> CALL_HI_WATER(ctx); # 1035| } # 1036| Error: GCC_ANALYZER_WARNING (CWE-775): [#def88] bind-9.18.41/lib/isc/net.c:178:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor 's' bind-9.18.41/lib/isc/net.c:120:13: acquire_resource: stream socket created here bind-9.18.41/lib/isc/net.c:121:12: branch_false: following 'false' branch (when 's != -1')... bind-9.18.41/lib/isc/net.c:142:12: branch_false: ...to here bind-9.18.41/lib/isc/net.c:142:12: branch_false: following 'false' branch (when 'domain != 10')... bind-9.18.41/lib/isc/net.c:178:15: branch_false: ...to here bind-9.18.41/lib/isc/net.c:178:15: throw: if 'close' throws an exception... bind-9.18.41/lib/isc/net.c:178:15: danger: 's' leaks here # 176| } # 177| # 178|-> (void)close(s); # 179| # 180| return result; Error: GCC_ANALYZER_WARNING (CWE-775): [#def89] bind-9.18.41/lib/isc/netmgr/udp.c:134:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup(fd)' bind-9.18.41/lib/isc/netmgr/udp.c:128:12: branch_false: following 'false' branch... bind-9.18.41/lib/isc/netmgr/udp.c:133:17: branch_false: ...to here bind-9.18.41/lib/isc/netmgr/udp.c:133:17: branch_true: following 'true' branch (when 'fd >= 0')... bind-9.18.41/lib/isc/netmgr/udp.c:134:29: branch_true: ...to here bind-9.18.41/lib/isc/netmgr/udp.c:134:29: acquire_resource: opened here bind-9.18.41/lib/isc/netmgr/udp.c:134:17: danger: 'dup(fd)' leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) # 132| } else { # 133| INSIST(fd >= 0); # 134|-> csock->fd = dup(fd); # 135| } # 136| INSIST(csock->fd >= 0); Error: GCC_ANALYZER_WARNING (CWE-404): [#def90] bind-9.18.41/lib/isccfg/parser.c:3536:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/isccfg/parser.c:3490:1: enter_function: entry to 'cfg_parser_warning' bind-9.18.41/lib/isccfg/parser.c:3494:9: branch_true: following 'true' branch (when 'pctx' is non-NULL)... bind-9.18.41/lib/isccfg/parser.c:3495:9: branch_true: ...to here bind-9.18.41/lib/isccfg/parser.c:3495:9: branch_true: following 'true' branch (when 'fmt' is non-NULL)... bind-9.18.41/lib/isccfg/parser.c:3497:9: branch_true: ...to here bind-9.18.41/lib/isccfg/parser.c:3497:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/isccfg/parser.c:3498:9: call_function: calling 'parser_complain' from 'cfg_parser_warning' # 3534| # 3535| fileobj = elt->obj; # 3536|-> INSIST(fileobj->type == &cfg_type_qstring); # 3537| return fileobj->value.string.base; # 3538| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def91] bind-9.18.41/lib/ns/client.c:2703:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/ns/client.c:2742:1: enter_function: entry to 'ns_client_log' bind-9.18.41/lib/ns/client.c:2746:12: branch_true: following 'true' branch... bind-9.18.41/lib/ns/client.c:2750:9: branch_true: ...to here bind-9.18.41/lib/ns/client.c:2750:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/ns/client.c:2751:9: call_function: calling 'ns_client_logv' from 'ns_client_log' # 2701| dns_name_t *q = NULL; # 2702| # 2703|-> REQUIRE(client != NULL); # 2704| # 2705| vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); Error: GCC_ANALYZER_WARNING (CWE-404): [#def92] bind-9.18.41/lib/ns/notify.c:40:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/ns/notify.c:39:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/ns/notify.c:40:9: throw: if 'ns_client_logv' throws an exception... bind-9.18.41/lib/ns/notify.c:40:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 38| # 39| va_start(ap, fmt); # 40|-> ns_client_logv(client, DNS_LOGCATEGORY_NOTIFY, NS_LOGMODULE_NOTIFY, # 41| level, fmt, ap); # 42| va_end(ap); Error: CPPCHECK_WARNING (CWE-457): [#def93] bind-9.18.41/lib/ns/query.c:3773: error[uninitvar]: Uninitialized variable: &in6a # 3771| INSIST(rdata.length == 16); # 3772| memmove(in6a.s6_addr, rdata.data, 16); # 3773|-> isc_netaddr_fromin6(&netaddr, &in6a); # 3774| break; # 3775| default: Error: CPPCHECK_WARNING (CWE-457): [#def94] bind-9.18.41/lib/ns/query.c:4599: error[uninitvar]: Uninitialized variable: &in6a # 4597| INSIST(rdata->length == 16); # 4598| memmove(in6a.s6_addr, rdata->data, 16); # 4599|-> isc_netaddr_fromin6(netaddr, &in6a); # 4600| return ISC_R_SUCCESS; # 4601| default: Error: GCC_ANALYZER_WARNING (CWE-404): [#def95] bind-9.18.41/lib/ns/query.c:9849:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/ns/query.c:9848:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/ns/query.c:9849:9: throw: if 'ns_client_logv' throws an exception... bind-9.18.41/lib/ns/query.c:9849:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 9847| # 9848| va_start(ap, fmt); # 9849|-> ns_client_logv(qctx->client, NS_LOGCATEGORY_QUERIES, NS_LOGMODULE_QUERY, # 9850| level, fmt, ap); # 9851| va_end(ap); Error: GCC_ANALYZER_WARNING (CWE-404): [#def96] bind-9.18.41/lib/ns/xfrout.c:1800:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/ns/xfrout.c:1812:1: enter_function: entry to 'xfrout_log1' bind-9.18.41/lib/ns/xfrout.c:1815:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/ns/xfrout.c:1816:9: call_function: calling 'xfrout_logv' from 'xfrout_log1' # 1798| char classbuf[DNS_RDATACLASS_FORMATSIZE]; # 1799| # 1800|-> dns_name_format(zonename, namebuf, sizeof(namebuf)); # 1801| dns_rdataclass_format(rdclass, classbuf, sizeof(classbuf)); # 1802| vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); Error: GCC_ANALYZER_WARNING (CWE-404): [#def97] bind-9.18.41/lib/ns/xfrout.c:1801:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end' bind-9.18.41/lib/ns/xfrout.c:1812:1: enter_function: entry to 'xfrout_log1' bind-9.18.41/lib/ns/xfrout.c:1815:9: acquire_resource: 'va_start' called here bind-9.18.41/lib/ns/xfrout.c:1816:9: call_function: calling 'xfrout_logv' from 'xfrout_log1' # 1799| # 1800| dns_name_format(zonename, namebuf, sizeof(namebuf)); # 1801|-> dns_rdataclass_format(rdclass, classbuf, sizeof(classbuf)); # 1802| vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); # 1803| ns_client_log(client, DNS_LOGCATEGORY_XFER_OUT, NS_LOGMODULE_XFER_OUT,
| analyzer-version-clippy | 1.92.0 |
| analyzer-version-cppcheck | 2.19.1 |
| analyzer-version-gcc | 16.0.0 |
| analyzer-version-gcc-analyzer | 16.0.0 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-230.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | bind-9.18.41-2.fc44 |
| store-results-to | /tmp/tmpuqj6_y6c/bind-9.18.41-2.fc44.tar.xz |
| time-created | 2026-01-08 15:36:59 |
| time-finished | 2026-01-08 15:42:31 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpuqj6_y6c/bind-9.18.41-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpuqj6_y6c/bind-9.18.41-2.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |