Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(20)

Unified Diff: src/cmd/upas/common/libsys.c

Issue 5370105: upas: fix segfault when host not found
Patch Set: Created 13 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/upas/common/libsys.c
===================================================================
--- a/src/cmd/upas/common/libsys.c
+++ b/src/cmd/upas/common/libsys.c
@@ -465,6 +465,9 @@
return namev;
h = gethostbyname(alt_sysname_read());
+ if(h == nil)
+ return 0;
+
for(p=h->h_aliases; *p; p++)
;
@@ -491,7 +494,7 @@
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){
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b