Commit 49ae04f6 authored by Mark Andrews's avatar Mark Andrews
Browse files

3677. [bug] 'nsupdate' leaked memory if 'realm' was used multiple

                        times.  [RT #35073]
parent aa5cb9ad
3677. [bug] 'nsupdate' leaked memory if 'realm' was used multiple
times. [RT #35073]
3676. [bug] "named-checkconf -z" now checks zones of type
hint and redirect as well as master. [RT #35046]
......
......@@ -1566,16 +1566,20 @@ evaluate_realm(char *cmdline) {
#ifdef GSSAPI
char *word;
char buf[1024];
int n;
word = nsu_strsep(&cmdline, " \t\r\n");
if (word == NULL || *word == 0) {
if (realm != NULL)
isc_mem_free(mctx, realm);
if (realm != NULL) {
isc_mem_free(mctx, realm);
realm = NULL;
return (STATUS_MORE);
}
snprintf(buf, sizeof(buf), "@%s", word);
word = nsu_strsep(&cmdline, " \t\r\n");
if (word == NULL || *word == 0)
return (STATUS_MORE);
n = snprintf(buf, sizeof(buf), "@%s", word);
if (n < 0 || (size_t)n >= sizeof(buf))
fatal("realm is too long");
realm = isc_mem_strdup(mctx, buf);
if (realm == NULL)
fatal("out of memory");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment