]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Based on #1257: check parse limit before t increment in sldns RR
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 26 Apr 2017 09:03:15 +0000 (09:03 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 26 Apr 2017 09:03:15 +0000 (09:03 +0000)
  string parse routine.

git-svn-id: file:///svn/unbound/trunk@4133 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
sldns/parse.c

index ee6e3222f1bf6df8277d9ce33353747bae838ae7..3b911d6866ea6b61653f0e06725629dd59528e03 100644 (file)
@@ -1,3 +1,7 @@
+26 April 2017: Wouter
+       - Based on #1257: check parse limit before t increment in sldns RR
+         string parse routine.
+
 24 April 2017: Wouter
        - unbound-checkconf -o allows query of dnstap config variables.
          Also unbound-control get_option.  Also for dnscrypt.
index 35dee719628ca233afb7792669c58462cc2fe6fb..e30a753a49bfcf529a704247dd27a1bd6e229b61 100644 (file)
@@ -120,6 +120,10 @@ sldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *l
                        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;