summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2007-03-22 12:30:53 +0000
committerotto <otto@openbsd.org>2007-03-22 12:30:53 +0000
commit197d368439f51b0b4401687a8d1cf985c4a533b9 (patch)
tree147d53634848311c25d5780028da45c3074c4a94
parentFix buffer overflow when parsing the .netrc file. (diff)
downloadwireguard-openbsd-197d368439f51b0b4401687a8d1cf985c4a533b9.tar.xz
wireguard-openbsd-197d368439f51b0b4401687a8d1cf985c4a533b9.zip
backout
*c && !isspace(*c) is not equivalent to !isspace(*c) ok millert@
-rw-r--r--usr.sbin/afs/src/lib/ko/kocell.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/afs/src/lib/ko/kocell.c b/usr.sbin/afs/src/lib/ko/kocell.c
index acf6b89f06d..0d94ed4107d 100644
--- a/usr.sbin/afs/src/lib/ko/kocell.c
+++ b/usr.sbin/afs/src/lib/ko/kocell.c
@@ -429,14 +429,14 @@ readdb (char *line, cell_entry* c, int *dbnum, int maxdbs,
return -1;
}
- while (isspace((unsigned char)*line))
+ while (*line && isspace((unsigned char)*line))
++line;
if (inet_aton (line, &numaddr) == 0) {
return -1;
}
- while (!isspace((unsigned char)*line) && *line != '#')
+ while (*line && !isspace((unsigned char)*line) && *line != '#')
++line;
hostname = line;
@@ -446,7 +446,7 @@ readdb (char *line, cell_entry* c, int *dbnum, int maxdbs,
eh = hostname;
- while (!isspace((unsigned char)*eh) && *eh != '#')
+ while (*eh && !isspace((unsigned char)*eh) && *eh != '#')
++eh;
*eh = '\0';
@@ -487,7 +487,7 @@ readcellservdb (const char *filename)
++lineno;
i = 0;
line[strcspn(line, "\n")] = '\0';
- while (isspace((unsigned char)line[i]))
+ while (line[0] && isspace((unsigned char)line[i]))
i++;
if (line[i] == '#' || line[i] == '\0')
continue;