summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Toorop <willem@nlnetlabs.nl>2017-04-27 00:14:58 (CEST)
committerWillem Toorop <willem@nlnetlabs.nl>2017-04-27 00:14:58 (CEST)
commitc8391790c96d4c8a2c10f9ab1460fda83b509fc2 (patch)
tree3d34083e7ea32b6df749ee7e2654b2c5386cb58a
parent95b243355648b922e3d2b1185d269efad6a085bf (diff)
downloadldns-c8391790.tar.gz
Thanks Stephan Zeisberg
-rw-r--r--Changelog2
-rw-r--r--parse.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index d746ccb..7786148 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,6 @@
1.7.1 ????-??-??
+ * bugfix #1256: Check parse limit before t increment
+ Thanks Stephan Zeisberg
* bugfix #1245: Only one signature per RRset needs to be valid with
ldns-verify-zone. Thanks Emil Natan.
* ldns-notify can use all supported hash algorithms with -y.
diff --git a/parse.c b/parse.c
index e68627c..947dbb8 100644
--- a/parse.c
+++ b/parse.c
@@ -118,6 +118,10 @@ ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *li
if (line_nr) {
*line_nr = *line_nr + 1;
}
+ if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
+ *t = '\0';
+ return -1;
+ }
*t++ = ' ';
prev_c = c;
continue;