diff options
author | Damien Miller <djm@mindrot.org> | 2002-04-23 21:00:33 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-04-23 21:00:33 +1000 |
commit | 635fe98a7f156688fc3182d597c88592823a3d22 (patch) | |
tree | c01ec8efeaa0ccb3f6b4c31cf9dec26108042e4e /radix.c | |
parent | f61c01506f8f78ccaacb55ba750a847486da3e5e (diff) |
- markus@cvs.openbsd.org 2002/04/22 06:15:47
[radix.c]
fix check for overflow
Diffstat (limited to 'radix.c')
-rw-r--r-- | radix.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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) |