diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2014-05-14 18:41:34 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2014-05-14 18:41:34 +0000 |
| commit | 65be028f32ed37dce84f6328d4a7172132c8c224 (patch) | |
| tree | 4edff3f361b23a13a9807a3a0906f9026c3a81a5 /parse.c | |
| parent | 04f3ab9612d73d7516f230df46e860daf892dc71 (diff) | |
Notes
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |
