Error: COMPILER_WARNING (CWE-704): [#def1] xauth-1.1.5/gethost.c: scope_hint: In function ‘get_address_info’ xauth-1.1.5/gethost.c:224:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 224 | c = strrchr(fulldpyname, '/'); # | ^ # 222| /* Use the bundle id (part preceding : in the basename) as our src id */ # 223| char *c; # 224|-> c = strrchr(fulldpyname, '/'); # 225| #ifdef HAVE_STRLCPY # 226| strlcpy(buf, (NULL != c) ? c + 1 : fulldpyname, sizeof(buf)); Error: COMPILER_WARNING (CWE-704): [#def2] xauth-1.1.5/gethost.c:224:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 222| /* Use the bundle id (part preceding : in the basename) as our src id */ # 223| char *c; # 224|-> c = strrchr(fulldpyname, '/'); # 225| #ifdef HAVE_STRLCPY # 226| strlcpy(buf, (NULL != c) ? c + 1 : fulldpyname, sizeof(buf)); Error: GCC_ANALYZER_WARNING (CWE-476): [#def3] xauth-1.1.5/gethost.c:238:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’ xauth-1.1.5/gethost.c:235:19: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:238:25: branch_false: ...to here xauth-1.1.5/gethost.c:238:25: danger: dereference of NULL ‘c’ # 236| src = fulldpyname; # 237| } else { # 238|-> *c = '\0'; # 239| src = buf; # 240| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] xauth-1.1.5/gethost.c:273:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ xauth-1.1.5/gethost.c:263:12: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:264:31: branch_false: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:269:37: branch_true: ...to here xauth-1.1.5/gethost.c:271:20: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:307:13: branch_false: ...to here xauth-1.1.5/gethost.c:307:37: branch_false: following ‘false’ branch (when ‘duplicate’ is NULL)... xauth-1.1.5/gethost.c:314:17: branch_false: ...to here xauth-1.1.5/gethost.c:314:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:316:20: branch_true: following ‘true’ branch (when ‘newrv’ is non-NULL)... xauth-1.1.5/gethost.c:317:38: branch_true: ...to here xauth-1.1.5/gethost.c:317:38: acquire_memory: allocated here xauth-1.1.5/gethost.c:318:24: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:319:25: branch_true: ...to here xauth-1.1.5/gethost.c:323:28: branch_true: following ‘true’ branch (when ‘retval’ is NULL)... xauth-1.1.5/gethost.c:264:57: branch_true: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:269:37: branch_true: ...to here xauth-1.1.5/gethost.c:271:20: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:273:25: branch_true: ...to here xauth-1.1.5/gethost.c:273:25: throw: if ‘get_local_hostname’ throws an exception... xauth-1.1.5/gethost.c:273:25: danger: ‘<unknown>’ leaks here; was allocated at [(17)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/16) # 271| if (*(const in_addr_t *) src == htonl(INADDR_LOOPBACK)) { # 272| family = FamilyLocal; # 273|-> if (get_local_hostname (buf, sizeof buf)) { # 274| src = buf; # 275| len = strlen (buf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def5] xauth-1.1.5/gethost.c:273:25: warning[-Wanalyzer-malloc-leak]: leak of ‘retval’ xauth-1.1.5/gethost.c:263:12: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:264:31: branch_false: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:269:37: branch_true: ...to here xauth-1.1.5/gethost.c:271:20: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:307:13: branch_false: ...to here xauth-1.1.5/gethost.c:307:37: branch_false: following ‘false’ branch (when ‘duplicate’ is NULL)... xauth-1.1.5/gethost.c:314:17: branch_false: ...to here xauth-1.1.5/gethost.c:314:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:315:42: acquire_memory: allocated here xauth-1.1.5/gethost.c:316:20: branch_true: following ‘true’ branch (when ‘newrv’ is non-NULL)... xauth-1.1.5/gethost.c:317:38: branch_true: ...to here xauth-1.1.5/gethost.c:318:24: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:319:25: branch_true: ...to here xauth-1.1.5/gethost.c:323:28: branch_true: following ‘true’ branch (when ‘retval’ is NULL)... xauth-1.1.5/gethost.c:264:57: branch_true: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:269:37: branch_true: ...to here xauth-1.1.5/gethost.c:271:20: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:273:25: branch_true: ...to here xauth-1.1.5/gethost.c:273:25: throw: if ‘get_local_hostname’ throws an exception... xauth-1.1.5/gethost.c:273:25: danger: ‘retval’ leaks here; was allocated at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14) # 271| if (*(const in_addr_t *) src == htonl(INADDR_LOOPBACK)) { # 272| family = FamilyLocal; # 273|-> if (get_local_hostname (buf, sizeof buf)) { # 274| src = buf; # 275| len = strlen (buf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] xauth-1.1.5/gethost.c:289:29: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ xauth-1.1.5/gethost.c:263:12: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:264:31: branch_false: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:269:37: branch_true: ...to here xauth-1.1.5/gethost.c:271:20: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:307:13: branch_false: ...to here xauth-1.1.5/gethost.c:307:37: branch_false: following ‘false’ branch (when ‘duplicate’ is NULL)... xauth-1.1.5/gethost.c:314:17: branch_false: ...to here xauth-1.1.5/gethost.c:314:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:316:20: branch_true: following ‘true’ branch (when ‘newrv’ is non-NULL)... xauth-1.1.5/gethost.c:317:38: branch_true: ...to here xauth-1.1.5/gethost.c:317:38: acquire_memory: allocated here xauth-1.1.5/gethost.c:318:24: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:319:25: branch_true: ...to here xauth-1.1.5/gethost.c:323:28: branch_true: following ‘true’ branch (when ‘retval’ is NULL)... xauth-1.1.5/gethost.c:264:57: branch_true: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:283:23: branch_false: ...to here xauth-1.1.5/gethost.c:283:23: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:284:38: branch_true: ...to here xauth-1.1.5/gethost.c:286:22: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:287:25: branch_false: ...to here xauth-1.1.5/gethost.c:287:25: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:289:29: throw: if ‘get_local_hostname’ throws an exception... xauth-1.1.5/gethost.c:289:29: danger: ‘<unknown>’ leaks here; was allocated at [(17)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/16) # 287| if (IN6_IS_ADDR_LOOPBACK((const struct in6_addr *)src)) { # 288| family = FamilyLocal; # 289|-> if (get_local_hostname (buf, sizeof buf)) { # 290| src = buf; # 291| len = strlen (buf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def7] xauth-1.1.5/gethost.c:289:29: warning[-Wanalyzer-malloc-leak]: leak of ‘retval’ xauth-1.1.5/gethost.c:263:12: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:264:31: branch_false: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:269:37: branch_true: ...to here xauth-1.1.5/gethost.c:271:20: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:307:13: branch_false: ...to here xauth-1.1.5/gethost.c:307:37: branch_false: following ‘false’ branch (when ‘duplicate’ is NULL)... xauth-1.1.5/gethost.c:314:17: branch_false: ...to here xauth-1.1.5/gethost.c:314:16: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:315:42: acquire_memory: allocated here xauth-1.1.5/gethost.c:316:20: branch_true: following ‘true’ branch (when ‘newrv’ is non-NULL)... xauth-1.1.5/gethost.c:317:38: branch_true: ...to here xauth-1.1.5/gethost.c:318:24: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:319:25: branch_true: ...to here xauth-1.1.5/gethost.c:323:28: branch_true: following ‘true’ branch (when ‘retval’ is NULL)... xauth-1.1.5/gethost.c:264:57: branch_true: ...to here xauth-1.1.5/gethost.c:264:45: branch_true: following ‘true’ branch (when ‘ai’ is non-NULL)... xauth-1.1.5/gethost.c:268:17: branch_true: ...to here xauth-1.1.5/gethost.c:268:16: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:283:23: branch_false: ...to here xauth-1.1.5/gethost.c:283:23: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:284:38: branch_true: ...to here xauth-1.1.5/gethost.c:286:22: branch_false: following ‘false’ branch... xauth-1.1.5/gethost.c:287:25: branch_false: ...to here xauth-1.1.5/gethost.c:287:25: branch_true: following ‘true’ branch... xauth-1.1.5/gethost.c:289:29: throw: if ‘get_local_hostname’ throws an exception... xauth-1.1.5/gethost.c:289:29: danger: ‘retval’ leaks here; was allocated at [(15)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/14) # 287| if (IN6_IS_ADDR_LOOPBACK((const struct in6_addr *)src)) { # 288| family = FamilyLocal; # 289|-> if (get_local_hostname (buf, sizeof buf)) { # 290| src = buf; # 291| len = strlen (buf); Error: GCC_ANALYZER_WARNING (CWE-122): [#def8] xauth-1.1.5/parsedpy.c:66:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow xauth-1.1.5/parsedpy.c:95:1: enter_function: entry to ‘parse_displayname’ xauth-1.1.5/parsedpy.c:112:8: branch_false: following ‘false’ branch... xauth-1.1.5/parsedpy.c:116:8: branch_false: following ‘false’ branch... xauth-1.1.5/parsedpy.c:128:8: branch_false: following ‘false’ branch (when ‘len != 0’)... xauth-1.1.5/parsedpy.c:141:15: branch_false: ...to here xauth-1.1.5/parsedpy.c:141:15: branch_true: following ‘true’ branch... xauth-1.1.5/parsedpy.c:144:16: call_function: calling ‘copystring’ from ‘parse_displayname’ # 64| if (cp) { # 65| if (src) memcpy (cp, src, len); # 66|-> cp[len] = '\0'; # 67| } # 68| return cp; Error: COMPILER_WARNING (CWE-704): [#def9] xauth-1.1.5/parsedpy.c: scope_hint: In function ‘parse_displayname’ xauth-1.1.5/parsedpy.c:115:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 115 | ptr = strrchr(displayname, ':'); # | ^ # 113| # 114| /* must have at least :number */ # 115|-> ptr = strrchr(displayname, ':'); # 116| if (!ptr || !ptr[1]) return False; # 117| if ((ptr != displayname) && (*(ptr - 1) == ':')) { Error: COMPILER_WARNING (CWE-704): [#def10] xauth-1.1.5/parsedpy.c:115:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 113| # 114| /* must have at least :number */ # 115|-> ptr = strrchr(displayname, ':'); # 116| if (!ptr || !ptr[1]) return False; # 117| if ((ptr != displayname) && (*(ptr - 1) == ':')) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def11] xauth-1.1.5/process.c:238:13: warning[-Wanalyzer-malloc-leak]: leak of ‘split_into_words(&buf, & subargc)’ xauth-1.1.5/process.c:1813:1: enter_function: entry to ‘do_source’ xauth-1.1.5/process.c:1822:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1830:10: call_function: calling ‘open_file’ from ‘do_source’ xauth-1.1.5/process.c:1830:10: return_function: returning to ‘do_source’ from ‘open_file’ xauth-1.1.5/process.c:1831:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1835:9: branch_false: ...to here xauth-1.1.5/process.c:1837:12: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1843:9: branch_true: ...to here xauth-1.1.5/process.c:1848:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1849:9: branch_false: ...to here xauth-1.1.5/process.c:1852:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1858:9: branch_false: ...to here xauth-1.1.5/process.c:1859:19: call_function: calling ‘split_into_words’ from ‘do_source’ xauth-1.1.5/process.c:1859:19: return_function: returning to ‘do_source’ from ‘split_into_words’ xauth-1.1.5/process.c:1860:12: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1861:26: branch_true: ...to here xauth-1.1.5/process.c:1861:26: call_function: calling ‘process_command’ from ‘do_source’ # 236| if (!s) return NULL; # 237| # 238|-> for ( ; *s && isascii(*s) && isspace(*s); s++) # 239| ; # 240| return s; Error: GCC_ANALYZER_WARNING (CWE-762): [#def12] xauth-1.1.5/process.c:297:24: warning[-Wanalyzer-mismatching-deallocation]: ‘argv’ should have been deallocated with ‘free’ but was deallocated with ‘reallocarray’ xauth-1.1.5/process.c:1813:1: enter_function: entry to ‘do_source’ xauth-1.1.5/process.c:1822:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1830:10: call_function: calling ‘open_file’ from ‘do_source’ xauth-1.1.5/process.c:1830:10: return_function: returning to ‘do_source’ from ‘open_file’ xauth-1.1.5/process.c:1831:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1835:9: branch_false: ...to here xauth-1.1.5/process.c:1837:12: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1843:9: branch_true: ...to here xauth-1.1.5/process.c:1848:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1849:9: branch_false: ...to here xauth-1.1.5/process.c:1852:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1858:9: branch_false: ...to here xauth-1.1.5/process.c:1859:19: call_function: calling ‘split_into_words’ from ‘do_source’ # 295| const char **new_argv; # 296| total += WORDSTOALLOC; # 297|-> new_argv = reallocarray (argv, total, sizeof (char *)); # 298| if (new_argv != NULL) { # 299| argv = new_argv; Error: GCC_ANALYZER_WARNING (CWE-401): [#def13] xauth-1.1.5/process.c:312:1: warning[-Wanalyzer-malloc-leak]: leak of ‘new_argv’ xauth-1.1.5/process.c:1813:1: enter_function: entry to ‘do_source’ xauth-1.1.5/process.c:1822:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1830:10: call_function: calling ‘open_file’ from ‘do_source’ xauth-1.1.5/process.c:1830:10: return_function: returning to ‘do_source’ from ‘open_file’ xauth-1.1.5/process.c:1831:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1835:9: branch_false: ...to here xauth-1.1.5/process.c:1837:12: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1843:9: branch_true: ...to here xauth-1.1.5/process.c:1848:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1849:9: branch_false: ...to here xauth-1.1.5/process.c:1852:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1858:9: branch_false: ...to here xauth-1.1.5/process.c:1859:19: call_function: calling ‘split_into_words’ from ‘do_source’ # 310| *argcp = cur; # 311| return argv; # 312|-> } # 313| # 314| Error: COMPILER_WARNING (CWE-762): [#def14] xauth-1.1.5/process.c: scope_hint: In function ‘read_numeric’ xauth-1.1.5/process.c:454:15: warning[-Wmismatched-dealloc]: ‘XauDisposeAuth’ called on pointer returned from a mismatched allocation function # 454 | if (auth) XauDisposeAuth (auth); /* won't free null pointers */ # | ^~~~~~~~~~~~~~~~~~~~~ xauth-1.1.5/process.c:416:12: note: returned from ‘malloc’ # 416 | auth = malloc (sizeof (Xauth)); # | ^~~~~~~~~~~~~~~~~~~~~~~ # 452| # 453| bad: # 454|-> if (auth) XauDisposeAuth (auth); /* won't free null pointers */ # 455| return NULL; # 456| } Error: COMPILER_WARNING (CWE-704): [#def15] xauth-1.1.5/process.c: scope_hint: In function ‘get_displayname_auth’ xauth-1.1.5/process.c:509:8: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 509 | cp = strchr(displayname, '/'); # | ^ # 507| * which is how the list routine prints out local connections # 508| */ # 509|-> cp = strchr(displayname, '/'); # 510| if (cp && strncmp (cp, "/unix:", 6) == 0) # 511| prelen = (cp - displayname); Error: COMPILER_WARNING (CWE-704): [#def16] xauth-1.1.5/process.c:509:8: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 507| * which is how the list routine prints out local connections # 508| */ # 509|-> cp = strchr(displayname, '/'); # 510| if (cp && strncmp (cp, "/unix:", 6) == 0) # 511| prelen = (cp - displayname); Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] xauth-1.1.5/process.c:513:10: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ xauth-1.1.5/process.c:1621:1: enter_function: entry to ‘do_add’ xauth-1.1.5/process.c:1631:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1642:8: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1643:15: acquire_memory: allocated here xauth-1.1.5/process.c:1644:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1648:32: branch_false: ...to here xauth-1.1.5/process.c:1669:10: call_function: calling ‘get_displayname_auth’ from ‘do_add’ # 511| prelen = (cp - displayname); # 512| # 513|-> if (!parse_displayname (displayname + ((prelen > 0) ? prelen + 1 : 0), # 514| &family, &host, &dpynum, &scrnum, &rest)) { # 515| return False; Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] xauth-1.1.5/process.c:518:21: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ xauth-1.1.5/process.c:1621:1: enter_function: entry to ‘do_add’ xauth-1.1.5/process.c:1631:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1642:8: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1643:15: acquire_memory: allocated here xauth-1.1.5/process.c:1644:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1648:32: branch_false: ...to here xauth-1.1.5/process.c:1669:10: call_function: calling ‘get_displayname_auth’ from ‘do_add’ # 516| } # 517| # 518|-> addrlist_head = get_address_info(family, displayname, prelen, host); # 519| if (addrlist_head) { # 520| char buf[40]; /* want to hold largest display num */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def19] xauth-1.1.5/process.c:539:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ xauth-1.1.5/process.c:1892:1: enter_function: entry to ‘do_generate’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1990:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1997:14: branch_false: ...to here xauth-1.1.5/process.c:1998:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2009:15: branch_false: ...to here xauth-1.1.5/process.c:2025:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2037:11: call_function: calling ‘bintohex’ from ‘do_generate’ xauth-1.1.5/process.c:2037:11: return_function: returning to ‘do_generate’ from ‘bintohex’ xauth-1.1.5/process.c:2043:14: call_function: calling ‘do_add’ from ‘do_generate’ # 537| # 538| if (authl_cur == NULL) { # 539|-> *authl = authl_cur = newal; # 540| } else { # 541| authl_cur->next = newal; Error: GCC_ANALYZER_WARNING (CWE-401): [#def20] xauth-1.1.5/process.c:539:21: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ xauth-1.1.5/process.c:1892:1: enter_function: entry to ‘do_generate’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1990:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1997:14: branch_false: ...to here xauth-1.1.5/process.c:1998:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2009:15: branch_false: ...to here xauth-1.1.5/process.c:2025:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2037:11: call_function: calling ‘bintohex’ from ‘do_generate’ xauth-1.1.5/process.c:2037:11: return_function: returning to ‘do_generate’ from ‘bintohex’ xauth-1.1.5/process.c:2043:14: call_function: calling ‘do_add’ from ‘do_generate’ # 537| # 538| if (authl_cur == NULL) { # 539|-> *authl = authl_cur = newal; # 540| } else { # 541| authl_cur->next = newal; Error: GCC_ANALYZER_WARNING (CWE-401): [#def21] xauth-1.1.5/process.c:551:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 549| auth->address = addrlist_cur->address; # 550| auth->address_length = addrlist_cur->len; # 551|-> auth->number = copystring(buf, dpylen); # 552| auth->number_length = dpylen; # 553| auth->name = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def22] xauth-1.1.5/process.c:551:32: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ xauth-1.1.5/process.c:1621:1: enter_function: entry to ‘do_add’ xauth-1.1.5/process.c:1631:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1642:8: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1643:15: acquire_memory: allocated here xauth-1.1.5/process.c:1644:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1648:32: branch_false: ...to here xauth-1.1.5/process.c:1669:10: call_function: calling ‘get_displayname_auth’ from ‘do_add’ # 549| auth->address = addrlist_cur->address; # 550| auth->address_length = addrlist_cur->len; # 551|-> auth->number = copystring(buf, dpylen); # 552| auth->number_length = dpylen; # 553| auth->name = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def23] xauth-1.1.5/process.c:551:32: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ xauth-1.1.5/process.c:1621:1: enter_function: entry to ‘do_add’ xauth-1.1.5/process.c:1631:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1642:8: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1644:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1648:32: branch_false: ...to here xauth-1.1.5/process.c:1669:10: call_function: calling ‘get_displayname_auth’ from ‘do_add’ # 549| auth->address = addrlist_cur->address; # 550| auth->address_length = addrlist_cur->len; # 551|-> auth->number = copystring(buf, dpylen); # 552| auth->number_length = dpylen; # 553| auth->name = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def24] xauth-1.1.5/process.c:551:32: warning[-Wanalyzer-malloc-leak]: leak of ‘proto_head’ xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 549| auth->address = addrlist_cur->address; # 550| auth->address_length = addrlist_cur->len; # 551|-> auth->number = copystring(buf, dpylen); # 552| auth->number_length = dpylen; # 553| auth->name = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def25] xauth-1.1.5/process.c:860:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’ xauth-1.1.5/process.c:1800:1: enter_function: entry to ‘do_quit’ xauth-1.1.5/process.c:1803:5: call_function: calling ‘die’ from ‘do_quit’ # 858| if (list->auth->name_length == 18 # 859| && strncmp(list->auth->name, "MIT-MAGIC-COOKIE-1", 18) == 0) { # 860|-> if (!XauWriteAuth(fp, list->auth)) { # 861| (void) fclose(fp); # 862| return -1; Error: GCC_ANALYZER_WARNING (CWE-401): [#def26] xauth-1.1.5/process.c:869:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’ xauth-1.1.5/process.c:1800:1: enter_function: entry to ‘do_quit’ xauth-1.1.5/process.c:1803:5: call_function: calling ‘die’ from ‘do_quit’ # 867| if (list->auth->name_length != 18 # 868| || strncmp(list->auth->name, "MIT-MAGIC-COOKIE-1", 18) != 0) { # 869|-> if (!XauWriteAuth(fp, list->auth)) { # 870| (void) fclose(fp); # 871| return -1; Error: GCC_ANALYZER_WARNING (CWE-401): [#def27] xauth-1.1.5/process.c:966:33: warning[-Wanalyzer-malloc-leak]: leak of ‘bintohex((unsigned int)*<unknown>.data_length, *<unknown>.data)’ xauth-1.1.5/process.c:1892:1: enter_function: entry to ‘do_generate’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1990:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1997:14: branch_false: ...to here xauth-1.1.5/process.c:1998:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2009:15: branch_false: ...to here xauth-1.1.5/process.c:2025:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2037:11: call_function: calling ‘bintohex’ from ‘do_generate’ xauth-1.1.5/process.c:2037:11: return_function: returning to ‘do_generate’ from ‘bintohex’ xauth-1.1.5/process.c:2043:14: call_function: calling ‘do_add’ from ‘do_generate’ # 964| # 965| /* two chars per byte, plus null termination */ # 966|-> starthex = hexdata = malloc((2 * len) + 1); # 967| if (!hexdata) # 968| return NULL; Error: GCC_ANALYZER_WARNING (CWE-688): [#def28] xauth-1.1.5/process.c:985:5: warning[-Wanalyzer-null-argument]: use of NULL ‘bintohex((unsigned int)len, cp)’ where non-null expected xauth-1.1.5/process.c:1577:1: enter_function: entry to ‘do_extract’ xauth-1.1.5/process.c:1595:14: call_function: calling ‘iterdpy’ from ‘do_extract’ #argument 1 of ‘__builtin_fputs’ must be non-null # 983| # 984| hex = bintohex(len, cp); # 985|-> fprintf(fp, "%s", hex); # 986| free(hex); # 987| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def29] xauth-1.1.5/process.c:1073:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘ed.fp’ xauth-1.1.5/process.c:1577:1: enter_function: entry to ‘do_extract’ xauth-1.1.5/process.c:1595:14: call_function: calling ‘iterdpy’ from ‘do_extract’ # 1071| } # 1072| } # 1073|-> (*(ed->numeric ? dump_numeric : XauWriteAuth)) (ed->fp, auth); # 1074| ed->nwritten++; # 1075| Error: GCC_ANALYZER_WARNING (CWE-401): [#def30] xauth-1.1.5/process.c:1073:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ed.fp’ xauth-1.1.5/process.c:1577:1: enter_function: entry to ‘do_extract’ xauth-1.1.5/process.c:1595:14: call_function: calling ‘iterdpy’ from ‘do_extract’ # 1071| } # 1072| } # 1073|-> (*(ed->numeric ? dump_numeric : XauWriteAuth)) (ed->fp, auth); # 1074| ed->nwritten++; # 1075| Error: GCC_ANALYZER_WARNING (CWE-688): [#def31] xauth-1.1.5/process.c:1087:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 1085| a->number_length == b->number_length && # 1086| a->name_length == b->name_length && # 1087|-> memcmp(a->address, b->address, a->address_length) == 0 && # 1088| memcmp(a->number, b->number, a->number_length) == 0 && # 1089| memcmp(a->name, b->name, a->name_length) == 0) ? 1 : 0); Error: GCC_ANALYZER_WARNING (CWE-688): [#def32] xauth-1.1.5/process.c:1088:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 1086| a->name_length == b->name_length && # 1087| memcmp(a->address, b->address, a->address_length) == 0 && # 1088|-> memcmp(a->number, b->number, a->number_length) == 0 && # 1089| memcmp(a->name, b->name, a->name_length) == 0) ? 1 : 0); # 1090| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def33] xauth-1.1.5/process.c:1089:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 1087| memcmp(a->address, b->address, a->address_length) == 0 && # 1088| memcmp(a->number, b->number, a->number_length) == 0 && # 1089|-> memcmp(a->name, b->name, a->name_length) == 0) ? 1 : 0); # 1090| } # 1091| Error: GCC_ANALYZER_WARNING (CWE-476): [#def34] xauth-1.1.5/process.c:1103:36: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’ xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 1101| match_auth_dpy(register Xauth *a, register Xauth *b) # 1102| { # 1103|-> if (a->family != FamilyWild && b->family != FamilyWild) { # 1104| /* Both "a" and "b" are not FamilyWild, they are "normal" families. */ # 1105| Error: GCC_ANALYZER_WARNING (CWE-688): [#def35] xauth-1.1.5/process.c:1116:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 1114| * "FamilyWild". */ # 1115| if (a->address_length != b->address_length || # 1116|-> memcmp(a->address, b->address, a->address_length) != 0) # 1117| return 0; # 1118| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def36] xauth-1.1.5/process.c:1120:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’ xauth-1.1.5/process.c:1735:1: enter_function: entry to ‘do_remove’ xauth-1.1.5/process.c:1740:8: branch_false: following ‘false’ branch (when ‘argc > 1’)... xauth-1.1.5/process.c:1746:14: branch_false: ...to here xauth-1.1.5/process.c:1746:14: call_function: calling ‘iterdpy’ from ‘do_remove’ # 1118| } # 1119| # 1120|-> if (a->number_length != 0 && b->number_length != 0) { # 1121| /* Both "a" and "b" have a number, make sure they match: */ # 1122| if (a->number_length != b->number_length || Error: GCC_ANALYZER_WARNING (CWE-401): [#def37] xauth-1.1.5/process.c:1330:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ xauth-1.1.5/process.c:1577:1: enter_function: entry to ‘do_extract’ xauth-1.1.5/process.c:1595:14: call_function: calling ‘iterdpy’ from ‘do_extract’ # 1328| } # 1329| } # 1330|-> XauDisposeAuth(tmp_auth); # 1331| if (matched == False) { # 1332| if (nfunc) { Error: GCC_ANALYZER_WARNING (CWE-762): [#def38] xauth-1.1.5/process.c:1330:13: warning[-Wanalyzer-mismatching-deallocation]: ‘copyAuth(*l.auth)’ should have been deallocated with ‘free’ but was deallocated with ‘XauDisposeAuth’ xauth-1.1.5/process.c:1577:1: enter_function: entry to ‘do_extract’ xauth-1.1.5/process.c:1595:14: call_function: calling ‘iterdpy’ from ‘do_extract’ # 1328| } # 1329| } # 1330|-> XauDisposeAuth(tmp_auth); # 1331| if (matched == False) { # 1332| if (nfunc) { Error: COMPILER_WARNING: [#def39] xauth-1.1.5/process.c: scope_hint: In function ‘do_merge’ xauth-1.1.5/process.c:1513:9: warning[-Wunused-but-set-variable=]: variable ‘errors’ set but not used # 1513 | int errors = 0; # | ^~~~~~ # 1511| do_merge(const char *inputfilename, int lineno, int argc, const char **argv) # 1512| { # 1513|-> int errors = 0; # 1514| AuthList *listhead, *listtail; # 1515| Bool numeric = False; Error: GCC_ANALYZER_WARNING (CWE-401): [#def40] xauth-1.1.5/process.c:1687:22: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ xauth-1.1.5/process.c:1621:1: enter_function: entry to ‘do_add’ xauth-1.1.5/process.c:1631:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1642:8: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1643:15: acquire_memory: allocated here xauth-1.1.5/process.c:1644:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1648:32: branch_false: ...to here xauth-1.1.5/process.c:1669:10: call_function: calling ‘get_displayname_auth’ from ‘do_add’ xauth-1.1.5/process.c:1669:10: return_function: returning to ‘do_add’ from ‘get_displayname_auth’ xauth-1.1.5/process.c:1669:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1679:9: branch_false: ...to here xauth-1.1.5/process.c:1683:28: branch_true: following ‘true’ branch (when ‘list_cur’ is non-NULL)... xauth-1.1.5/process.c:1684:16: branch_true: ...to here xauth-1.1.5/process.c:1687:22: throw: if ‘copystring’ throws an exception... xauth-1.1.5/process.c:1687:22: danger: ‘key’ leaks here; was allocated at [(6)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/5) # 1685| # 1686| auth->name_length = strlen (protoname); # 1687|-> auth->name = copystring (protoname, auth->name_length); # 1688| if (!auth->name) { # 1689| prefix (inputfilename, lineno); Error: GCC_ANALYZER_WARNING (CWE-401): [#def41] xauth-1.1.5/process.c:1694:17: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ xauth-1.1.5/process.c:1621:1: enter_function: entry to ‘do_add’ xauth-1.1.5/process.c:1631:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1642:8: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1643:15: acquire_memory: allocated here xauth-1.1.5/process.c:1644:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1648:32: branch_false: ...to here xauth-1.1.5/process.c:1669:10: call_function: calling ‘get_displayname_auth’ from ‘do_add’ xauth-1.1.5/process.c:1669:10: return_function: returning to ‘do_add’ from ‘get_displayname_auth’ xauth-1.1.5/process.c:1669:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1679:9: branch_false: ...to here xauth-1.1.5/process.c:1683:28: branch_true: following ‘true’ branch (when ‘list_cur’ is non-NULL)... xauth-1.1.5/process.c:1684:16: branch_true: ...to here xauth-1.1.5/process.c:1688:12: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1689:13: branch_true: ...to here xauth-1.1.5/process.c:1692:35: branch_true: following ‘true’ branch (when ‘list_cur’ is non-NULL)... xauth-1.1.5/process.c:1693:17: branch_true: ...to here xauth-1.1.5/process.c:1694:17: throw: if ‘XauDisposeAuth’ throws an exception... xauth-1.1.5/process.c:1694:17: danger: ‘key’ leaks here; was allocated at [(6)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/5) # 1692| for (list_cur = list; list_cur != NULL; list_cur = list_next) { # 1693| list_next = list_cur->next; # 1694|-> XauDisposeAuth(list_cur->auth); # 1695| free(list_cur); # 1696| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def42] xauth-1.1.5/process.c:1707:25: warning[-Wanalyzer-malloc-leak]: leak of ‘key’ xauth-1.1.5/process.c:1621:1: enter_function: entry to ‘do_add’ xauth-1.1.5/process.c:1631:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1642:8: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1643:15: acquire_memory: allocated here xauth-1.1.5/process.c:1644:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1648:32: branch_false: ...to here xauth-1.1.5/process.c:1669:10: call_function: calling ‘get_displayname_auth’ from ‘do_add’ xauth-1.1.5/process.c:1669:10: return_function: returning to ‘do_add’ from ‘get_displayname_auth’ xauth-1.1.5/process.c:1669:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1679:9: branch_false: ...to here xauth-1.1.5/process.c:1683:28: branch_true: following ‘true’ branch (when ‘list_cur’ is non-NULL)... xauth-1.1.5/process.c:1684:16: branch_true: ...to here xauth-1.1.5/process.c:1688:12: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1700:9: branch_false: ...to here xauth-1.1.5/process.c:1702:12: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1703:17: branch_true: ...to here xauth-1.1.5/process.c:1705:39: branch_true: following ‘true’ branch (when ‘list_cur’ is non-NULL)... xauth-1.1.5/process.c:1706:25: branch_true: ...to here xauth-1.1.5/process.c:1707:25: throw: if ‘XauDisposeAuth’ throws an exception... xauth-1.1.5/process.c:1707:25: danger: ‘key’ leaks here; was allocated at [(6)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/5) # 1705| for (list_cur = list; list_cur != NULL; list_cur = list_next) { # 1706| list_next = list_cur->next; # 1707|-> XauDisposeAuth(list_cur->auth); # 1708| free(list_cur); # 1709| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def43] xauth-1.1.5/process.c:1960:17: warning[-Wanalyzer-malloc-leak]: leak of ‘authdata’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1921:21: branch_true: following ‘true’ branch (when ‘i < argc’)... xauth-1.1.5/process.c:1922:29: branch_true: ...to here xauth-1.1.5/process.c:1932:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1936:25: branch_false: ...to here xauth-1.1.5/process.c:1936:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1940:25: branch_false: ...to here xauth-1.1.5/process.c:1940:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1950:25: branch_false: ...to here xauth-1.1.5/process.c:1950:19: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:1951:16: branch_true: ...to here xauth-1.1.5/process.c:1951:16: branch_false: following ‘false’ branch (when ‘argc != i’)... xauth-1.1.5/process.c:1957:27: branch_false: ...to here xauth-1.1.5/process.c:1959:16: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1960:28: acquire_memory: allocated here xauth-1.1.5/process.c:1961:20: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1966:46: branch_false: ...to here xauth-1.1.5/process.c:1921:21: branch_true: following ‘true’ branch (when ‘i < argc’)... xauth-1.1.5/process.c:1922:29: branch_true: ...to here xauth-1.1.5/process.c:1932:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1936:25: branch_false: ...to here xauth-1.1.5/process.c:1936:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1940:25: branch_false: ...to here xauth-1.1.5/process.c:1940:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1950:25: branch_false: ...to here xauth-1.1.5/process.c:1950:19: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:1951:16: branch_true: ...to here xauth-1.1.5/process.c:1951:16: branch_false: following ‘false’ branch (when ‘argc != i’)... xauth-1.1.5/process.c:1957:27: branch_false: ...to here xauth-1.1.5/process.c:1959:16: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1960:17: danger: ‘authdata’ leaks here; was allocated at [(17)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/16) # 1958| authdatalen = strlen(hexdata); # 1959| if (hexdata[0] == '"' && hexdata[authdatalen-1] == '"') { # 1960|-> authdata = malloc(authdatalen-1); # 1961| if (!authdata) { # 1962| fprintf(stderr, "unable to allocate memory\n"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def44] xauth-1.1.5/process.c:1989:11: warning[-Wanalyzer-malloc-leak]: leak of ‘authdata’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1921:21: branch_true: following ‘true’ branch (when ‘i < argc’)... xauth-1.1.5/process.c:1922:29: branch_true: ...to here xauth-1.1.5/process.c:1932:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1936:25: branch_false: ...to here xauth-1.1.5/process.c:1936:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1940:25: branch_false: ...to here xauth-1.1.5/process.c:1940:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1950:25: branch_false: ...to here xauth-1.1.5/process.c:1950:19: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:1951:16: branch_true: ...to here xauth-1.1.5/process.c:1951:16: branch_false: following ‘false’ branch (when ‘argc != i’)... xauth-1.1.5/process.c:1957:27: branch_false: ...to here xauth-1.1.5/process.c:1959:16: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1960:28: acquire_memory: allocated here xauth-1.1.5/process.c:1961:20: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1966:46: branch_false: ...to here xauth-1.1.5/process.c:1989:11: throw: if ‘XOpenDisplay’ throws an exception... xauth-1.1.5/process.c:1989:11: danger: ‘authdata’ leaks here; was allocated at [(17)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/16) # 1987| /* generate authorization using the Security extension */ # 1988| # 1989|-> dpy = XOpenDisplay (displayname); # 1990| if (!dpy) { # 1991| prefix (inputfilename, lineno); Error: GCC_ANALYZER_WARNING (CWE-401): [#def45] xauth-1.1.5/process.c:1997:14: warning[-Wanalyzer-malloc-leak]: leak of ‘authdata’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1921:21: branch_true: following ‘true’ branch (when ‘i < argc’)... xauth-1.1.5/process.c:1922:29: branch_true: ...to here xauth-1.1.5/process.c:1932:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1936:25: branch_false: ...to here xauth-1.1.5/process.c:1936:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1940:25: branch_false: ...to here xauth-1.1.5/process.c:1940:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1950:25: branch_false: ...to here xauth-1.1.5/process.c:1950:19: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:1951:16: branch_true: ...to here xauth-1.1.5/process.c:1951:16: branch_false: following ‘false’ branch (when ‘argc != i’)... xauth-1.1.5/process.c:1957:27: branch_false: ...to here xauth-1.1.5/process.c:1959:16: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1960:28: acquire_memory: allocated here xauth-1.1.5/process.c:1961:20: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1966:46: branch_false: ...to here xauth-1.1.5/process.c:1990:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1997:14: branch_false: ...to here xauth-1.1.5/process.c:1997:14: throw: if ‘XSecurityQueryExtension’ throws an exception... xauth-1.1.5/process.c:1997:14: danger: ‘authdata’ leaks here; was allocated at [(17)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/16) # 1995| } # 1996| # 1997|-> status = XSecurityQueryExtension(dpy, &major_version, &minor_version); # 1998| if (!status) # 1999| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def46] xauth-1.1.5/process.c:2009:15: warning[-Wanalyzer-malloc-leak]: leak of ‘authdata’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1921:21: branch_true: following ‘true’ branch (when ‘i < argc’)... xauth-1.1.5/process.c:1922:29: branch_true: ...to here xauth-1.1.5/process.c:1932:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1936:25: branch_false: ...to here xauth-1.1.5/process.c:1936:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1940:25: branch_false: ...to here xauth-1.1.5/process.c:1940:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1950:25: branch_false: ...to here xauth-1.1.5/process.c:1950:19: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:1951:16: branch_true: ...to here xauth-1.1.5/process.c:1951:16: branch_false: following ‘false’ branch (when ‘argc != i’)... xauth-1.1.5/process.c:1957:27: branch_false: ...to here xauth-1.1.5/process.c:1959:16: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1960:28: acquire_memory: allocated here xauth-1.1.5/process.c:1961:20: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1966:46: branch_false: ...to here xauth-1.1.5/process.c:1990:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1997:14: branch_false: ...to here xauth-1.1.5/process.c:1998:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2009:15: branch_false: ...to here xauth-1.1.5/process.c:2009:15: throw: if ‘XSecurityAllocXauth’ throws an exception... xauth-1.1.5/process.c:2009:15: danger: ‘authdata’ leaks here; was allocated at [(17)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/16) # 2007| /* fill in input Xauth struct */ # 2008| # 2009|-> auth_in = XSecurityAllocXauth(); # 2010| if (strcmp (protoname, DEFAULT_PROTOCOL_ABBREV) == 0) { # 2011| auth_in->name = copystring(DEFAULT_PROTOCOL, strlen(DEFAULT_PROTOCOL)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def47] xauth-1.1.5/process.c:2011:26: warning[-Wanalyzer-malloc-leak]: leak of ‘authdata’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1921:21: branch_true: following ‘true’ branch (when ‘i < argc’)... xauth-1.1.5/process.c:1922:29: branch_true: ...to here xauth-1.1.5/process.c:1932:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1936:25: branch_false: ...to here xauth-1.1.5/process.c:1936:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1940:25: branch_false: ...to here xauth-1.1.5/process.c:1940:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1950:25: branch_false: ...to here xauth-1.1.5/process.c:1950:19: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:1951:16: branch_true: ...to here xauth-1.1.5/process.c:1951:16: branch_false: following ‘false’ branch (when ‘argc != i’)... xauth-1.1.5/process.c:1957:27: branch_false: ...to here xauth-1.1.5/process.c:1959:16: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1960:28: acquire_memory: allocated here xauth-1.1.5/process.c:1961:20: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1966:46: branch_false: ...to here xauth-1.1.5/process.c:1990:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1997:14: branch_false: ...to here xauth-1.1.5/process.c:1998:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2009:15: branch_false: ...to here xauth-1.1.5/process.c:2010:8: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:2011:26: branch_true: ...to here xauth-1.1.5/process.c:2011:26: throw: if ‘copystring’ throws an exception... xauth-1.1.5/process.c:2011:26: danger: ‘authdata’ leaks here; was allocated at [(17)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/16) # 2009| auth_in = XSecurityAllocXauth(); # 2010| if (strcmp (protoname, DEFAULT_PROTOCOL_ABBREV) == 0) { # 2011|-> auth_in->name = copystring(DEFAULT_PROTOCOL, strlen(DEFAULT_PROTOCOL)); # 2012| } # 2013| else Error: GCC_ANALYZER_WARNING (CWE-401): [#def48] xauth-1.1.5/process.c:2014:25: warning[-Wanalyzer-malloc-leak]: leak of ‘authdata’ xauth-1.1.5/process.c:1909:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1921:21: branch_true: following ‘true’ branch (when ‘i < argc’)... xauth-1.1.5/process.c:1922:29: branch_true: ...to here xauth-1.1.5/process.c:1932:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1936:25: branch_false: ...to here xauth-1.1.5/process.c:1936:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1940:25: branch_false: ...to here xauth-1.1.5/process.c:1940:19: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:1950:25: branch_false: ...to here xauth-1.1.5/process.c:1950:19: branch_true: following ‘true’ branch (when the strings are equal)... xauth-1.1.5/process.c:1951:16: branch_true: ...to here xauth-1.1.5/process.c:1951:16: branch_false: following ‘false’ branch (when ‘argc != i’)... xauth-1.1.5/process.c:1957:27: branch_false: ...to here xauth-1.1.5/process.c:1959:16: branch_true: following ‘true’ branch... xauth-1.1.5/process.c:1960:28: acquire_memory: allocated here xauth-1.1.5/process.c:1961:20: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1966:46: branch_false: ...to here xauth-1.1.5/process.c:1990:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:1997:14: branch_false: ...to here xauth-1.1.5/process.c:1998:8: branch_false: following ‘false’ branch... xauth-1.1.5/process.c:2009:15: branch_false: ...to here xauth-1.1.5/process.c:2010:8: branch_false: following ‘false’ branch (when the strings are non-equal)... xauth-1.1.5/process.c:2014:48: branch_false: ...to here xauth-1.1.5/process.c:2014:25: throw: if ‘copystring’ throws an exception... xauth-1.1.5/process.c:2014:25: danger: ‘authdata’ leaks here; was allocated at [(17)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/16) # 2012| } # 2013| else # 2014|-> auth_in->name = copystring (protoname, strlen(protoname)); # 2015| auth_in->name_length = strlen(auth_in->name); # 2016| auth_in->data = authdata;
| 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-55.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 | xorg-x11-xauth-1.1.5-1.fc44 |
| store-results-to | /tmp/tmpt537e_o0/xorg-x11-xauth-1.1.5-1.fc44.tar.xz |
| time-created | 2026-01-08 22:19:25 |
| time-finished | 2026-01-08 22:20:43 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpt537e_o0/xorg-x11-xauth-1.1.5-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpt537e_o0/xorg-x11-xauth-1.1.5-1.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |