summaryrefslogtreecommitdiffstats
path: root/infomanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'infomanager.cpp')
-rw-r--r--infomanager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/infomanager.cpp b/infomanager.cpp
index 864c431a5..2a4c3c892 100644
--- a/infomanager.cpp
+++ b/infomanager.cpp
@@ -67,16 +67,18 @@ int InfoManager::LoadValues(void) {
string Name;
string Value;
unsigned short length;
- char array[512];
+ char array[513];
if (fread(&length, 1, sizeof(unsigned short), in) != sizeof(unsigned short)) goto error;
if (length >= 512) goto error;
if (fread(array, 1, length, in) != length) goto error;
+ array[length+1] = '\0';
Name = array;
if (fread(&length, 1, sizeof(unsigned short), in) != sizeof(unsigned short)) goto error;
if (length >= 512) goto error;
if (fread(array, 1, length, in) != length) goto error;
+ array[length+1] = '\0';
Value = array;
map<string, string>::iterator pos;