From ffaae2b52b5aa5e7c37aff45ea7c36a23fb055bc Mon Sep 17 00:00:00 2001 From: bert hubert Date: Wed, 6 May 2015 20:48:17 +0200 Subject: [PATCH] be careful reading empty lines in our config parser and prevent integer overflow. 1 line diff. (cherry picked from commit 83281a74766e31ff7197c7ebc4a331e9dad89e8f) --- pdns/arguments.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/arguments.cc b/pdns/arguments.cc index 9f4e1cacc..c154d0e82 100644 --- a/pdns/arguments.cc +++ b/pdns/arguments.cc @@ -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; } -- 2.40.0