summaryrefslogtreecommitdiff
path: root/sldns/parse.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2019-12-28 05:27:06 +0000
committerCy Schubert <cy@FreeBSD.org>2019-12-28 05:27:06 +0000
commite2fe726866d062155f6b1aae749375475ef19191 (patch)
treefe6b00611d5c987d2c12c32063891ae19295ffeb /sldns/parse.c
parent366b94c4a9552acfb560d3234aea0955ebc1eb8e (diff)
Diffstat (limited to 'sldns/parse.c')
-rw-r--r--sldns/parse.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sldns/parse.c b/sldns/parse.c
index b62c405977561..b30264e88e794 100644
--- a/sldns/parse.c
+++ b/sldns/parse.c
@@ -325,8 +325,14 @@ sldns_bget_token_par(sldns_buffer *b, char *token, const char *delim,
if (c == '\n' && p != 0) {
/* in parentheses */
/* do not write ' ' if we want to skip spaces */
- if(!(skipw && (strchr(skipw, c)||strchr(skipw, ' '))))
+ if(!(skipw && (strchr(skipw, c)||strchr(skipw, ' ')))) {
+ /* check for space for the space character */
+ if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
+ *t = '\0';
+ return -1;
+ }
*t++ = ' ';
+ }
lc = c;
continue;
}