diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-09-11 06:15:06 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-09-11 06:15:06 +0000 |
commit | cb1c88d42b0ee5e950d85e933c6eb6ecb8175e1d (patch) | |
tree | 46602c88cbbd340691a76917100cc2cdeadebc04 /src/network | |
parent | 878887c50cccd45b5cabe6ed2ac743941f3417ea (diff) | |
download | musl-cb1c88d42b0ee5e950d85e933c6eb6ecb8175e1d.zip musl-cb1c88d42b0ee5e950d85e933c6eb6ecb8175e1d.tar.gz musl-cb1c88d42b0ee5e950d85e933c6eb6ecb8175e1d.tar.bz2 |
fix uninitialized scopeid in lookups from hosts file and ip literals
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/lookup_ipliteral.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/lookup_ipliteral.c b/src/network/lookup_ipliteral.c index 7bcb85f..7ca70b2 100644 --- a/src/network/lookup_ipliteral.c +++ b/src/network/lookup_ipliteral.c @@ -24,7 +24,7 @@ int __lookup_ipliteral(struct address buf[static 1], const char *name, int famil if (family != AF_INET) { char tmp[64]; char *p = strchr(name, '%'), *z; - unsigned long long scopeid; + unsigned long long scopeid = 0; if (p && p-name < 64) { memcpy(tmp, name, p-name); tmp[p-name] = 0; @@ -44,8 +44,8 @@ int __lookup_ipliteral(struct address buf[static 1], const char *name, int famil if (!scopeid) return EAI_NONAME; } if (scopeid > UINT_MAX) return EAI_NONAME; - buf[0].scopeid = scopeid; } + buf[0].scopeid = scopeid; return 1; } return 0; |