mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
upas: fix segfault when host not found
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5370105
This commit is contained in:
parent
81c30b5a75
commit
38bcdc42b5
1 changed files with 4 additions and 1 deletions
|
@ -465,6 +465,9 @@ sysnames_read(void)
|
|||
return namev;
|
||||
|
||||
h = gethostbyname(alt_sysname_read());
|
||||
if(h == nil)
|
||||
return 0;
|
||||
|
||||
for(p=h->h_aliases; *p; p++)
|
||||
;
|
||||
|
||||
|
@ -491,7 +494,7 @@ domainname_read(void)
|
|||
char **namev, *p;
|
||||
Ndbtuple *t;
|
||||
|
||||
for(namev = sysnames_read(); *namev; namev++){
|
||||
for(namev = sysnames_read(); namev && *namev; namev++){
|
||||
if(strchr(*namev, '.')){
|
||||
for(p=*namev-1; p && *++p; p=strchr(p, '.')){
|
||||
if((t = dnsquery(nil, p, "mx")) != nil){
|
||||
|
|
Loading…
Reference in a new issue