mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +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;
|
return namev;
|
||||||
|
|
||||||
h = gethostbyname(alt_sysname_read());
|
h = gethostbyname(alt_sysname_read());
|
||||||
|
if(h == nil)
|
||||||
|
return 0;
|
||||||
|
|
||||||
for(p=h->h_aliases; *p; p++)
|
for(p=h->h_aliases; *p; p++)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -491,7 +494,7 @@ domainname_read(void)
|
||||||
char **namev, *p;
|
char **namev, *p;
|
||||||
Ndbtuple *t;
|
Ndbtuple *t;
|
||||||
|
|
||||||
for(namev = sysnames_read(); *namev; namev++){
|
for(namev = sysnames_read(); namev && *namev; namev++){
|
||||||
if(strchr(*namev, '.')){
|
if(strchr(*namev, '.')){
|
||||||
for(p=*namev-1; p && *++p; p=strchr(p, '.')){
|
for(p=*namev-1; p && *++p; p=strchr(p, '.')){
|
||||||
if((t = dnsquery(nil, p, "mx")) != nil){
|
if((t = dnsquery(nil, p, "mx")) != nil){
|
||||||
|
|
Loading…
Reference in a new issue