]> granicus.if.org Git - pdns/commitdiff
be careful reading empty lines in our config parser and prevent integer overflow...
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 6 May 2015 18:48:17 +0000 (20:48 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 9 May 2015 13:20:56 +0000 (15:20 +0200)
(cherry picked from commit 83281a74766e31ff7197c7ebc4a331e9dad89e8f)

pdns/arguments.cc

index 9f4e1caccd8443274a641615949c2349d88023b0..c154d0e82880484388c0bc0965bd1fce92282a8f 100644 (file)
@@ -390,7 +390,7 @@ bool ArgvMap::parseFile(const char *fname, const string& arg, bool lax) {
   while(getline(f,pline)) {
     trim_right(pline);
     
-    if(pline[pline.size()-1]=='\\') {
+    if(!pline.empty() && pline[pline.size()-1]=='\\') {
       line+=pline.substr(0,pline.length()-1);
       continue;
     }