From 2a939e6d9ba3145d5a43b23d2ae8fd4f5aa6593d Mon Sep 17 00:00:00 2001 From: bl0ckeduser Date: Thu, 17 Nov 2011 14:00:30 -0500 Subject: [PATCH] Fix crash in config file loader --- conffile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conffile.cpp b/conffile.cpp index 2923ecc8..b7f60298 100644 --- a/conffile.cpp +++ b/conffile.cpp @@ -280,7 +280,7 @@ void ConfigFile::LoadFile(Reader *r, const char *name){ } key=l.substr(0,i); ConfigEntry::trim(key); val=l.substr(i+1); comment = ConfigEntry::trimCommented(val); - if(val[0]=='"' && *val.rbegin()=='"') val=val.substr(1, val.size()-2); + if(val.size() > 0 && val[0]=='"' && *val.rbegin()=='"') val=val.substr(1, val.size()-2); ConfigEntry e(line, section, key, val); e.comment = comment;