summaryrefslogtreecommitdiff
path: root/radix.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-04-23 21:00:33 +1000
committerDamien Miller <djm@mindrot.org>2002-04-23 21:00:33 +1000
commit635fe98a7f156688fc3182d597c88592823a3d22 (patch)
treec01ec8efeaa0ccb3f6b4c31cf9dec26108042e4e /radix.c
parentf61c01506f8f78ccaacb55ba750a847486da3e5e (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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/radix.c b/radix.c
index 94e3dc70e..85ca9c329 100644
--- a/radix.c
+++ b/radix.c
@@ -26,7 +26,7 @@
26#include "includes.h" 26#include "includes.h"
27#include "uuencode.h" 27#include "uuencode.h"
28 28
29RCSID("$OpenBSD: radix.c,v 1.18 2002/04/20 09:17:19 markus Exp $"); 29RCSID("$OpenBSD: radix.c,v 1.19 2002/04/22 06:15:47 markus Exp $");
30 30
31#ifdef AFS 31#ifdef AFS
32#include <krb.h> 32#include <krb.h>
@@ -76,15 +76,17 @@ creds_to_radix(CREDENTIALS *creds, u_char *buf, size_t buflen)
76 76
77#define GETSTRING(b, t, tlen) \ 77#define GETSTRING(b, t, tlen) \
78 do { \ 78 do { \
79 int i; \ 79 int i, found = 0; \
80 for (i = 0; i < tlen; i++) { \ 80 for (i = 0; i < tlen; i++) { \
81 if (buffer_len(b) == 0) \ 81 if (buffer_len(b) == 0) \
82 goto done; \ 82 goto done; \
83 t[i] = buffer_get_char(b); \ 83 t[i] = buffer_get_char(b); \
84 if (t[i] == '\0') \ 84 if (t[i] == '\0') { \
85 found = 1; \
85 break; \ 86 break; \
87 } \
86 } \ 88 } \
87 if (t[i] != '\0') \ 89 if (!found) \
88 goto done; \ 90 goto done; \
89 } while(0) 91 } while(0)
90 92