summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-04-22 06:15:48 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-04-22 06:15:48 +0000
commit83f5ae8f5f06fdfdcb4a758123869cbe97e57f47 (patch)
tree0cf87cef5731e1cac2d7cc0b53a24957e467b225 /usr.bin
parent120329df858051aaef7b6b39295d669b40dbdb88 (diff)
fix check for overflow
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/radix.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/ssh/radix.c b/usr.bin/ssh/radix.c
index 94e3dc70eb3..85ca9c32967 100644
--- a/usr.bin/ssh/radix.c
+++ b/usr.bin/ssh/radix.c
@@ -26,7 +26,7 @@
#include "includes.h"
#include "uuencode.h"
-RCSID("$OpenBSD: radix.c,v 1.18 2002/04/20 09:17:19 markus Exp $");
+RCSID("$OpenBSD: radix.c,v 1.19 2002/04/22 06:15:47 markus Exp $");
#ifdef AFS
#include <krb.h>
@@ -76,15 +76,17 @@ creds_to_radix(CREDENTIALS *creds, u_char *buf, size_t buflen)
#define GETSTRING(b, t, tlen) \
do { \
- int i; \
+ int i, found = 0; \
for (i = 0; i < tlen; i++) { \
if (buffer_len(b) == 0) \
goto done; \
t[i] = buffer_get_char(b); \
- if (t[i] == '\0') \
+ if (t[i] == '\0') { \
+ found = 1; \
break; \
+ } \
} \
- if (t[i] != '\0') \
+ if (!found) \
goto done; \
} while(0)