summaryrefslogtreecommitdiffstats
path: root/contrib/ldns/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ldns/parse.c')
-rw-r--r--contrib/ldns/parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/ldns/parse.c b/contrib/ldns/parse.c
index 8849eff..710c4e7 100644
--- a/contrib/ldns/parse.c
+++ b/contrib/ldns/parse.c
@@ -135,7 +135,7 @@ ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *li
if (c != '\0' && c != '\n') {
i++;
}
- if (limit > 0 && i >= limit) {
+ if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
*t = '\0';
return -1;
}
@@ -308,7 +308,7 @@ ldns_bget_token(ldns_buffer *b, char *token, const char *delim, size_t limit)
}
i++;
- if (limit > 0 && i >= limit) {
+ if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
*t = '\0';
return -1;
}
OpenPOWER on IntegriCloud