From 0782d106dbfb07aa470a573222092fbca2908a53 Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Fri, 23 May 2014 03:17:19 -0400 Subject: [PATCH] Check for errors when reading lines from ini files. Fixes issue 7283. --- Source/Core/Common/IniFile.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index fc90b3500e..1fc302bac8 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -345,8 +345,11 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data) while (!in.eof()) { char templine[MAX_BYTES]; - in.getline(templine, MAX_BYTES); - std::string line = templine; + std::string line; + if (in.getline(templine, MAX_BYTES)) + line = templine; + else + return false; #ifndef _WIN32 // Check for CRLF eol and convert it to LF