Reserve space for The Terminator
authorGé van Geldorp <ge@gse.nl>
Thu, 8 Sep 2005 13:08:21 +0000 (13:08 +0000)
committerGé van Geldorp <ge@gse.nl>
Thu, 8 Sep 2005 13:08:21 +0000 (13:08 +0000)
svn path=/trunk/; revision=17739

reactos/boot/freeldr/freeldr/inifile/inifile.c

index feb05bc..ab20274 100644 (file)
@@ -218,7 +218,7 @@ BOOL IniAddSettingValueToSection(ULONG SectionId, PCHAR SettingName, PCHAR Setti
        RtlZeroMemory(SectionItem, sizeof(INI_SECTION_ITEM));
 
        // Allocate the setting name buffer
        RtlZeroMemory(SectionItem, sizeof(INI_SECTION_ITEM));
 
        // Allocate the setting name buffer
-       SectionItem->ItemName = MmAllocateMemory(strlen(SettingName));
+       SectionItem->ItemName = MmAllocateMemory(strlen(SettingName) + 1);
        if (!SectionItem->ItemName)
        {
                MmFreeMemory(SectionItem);
        if (!SectionItem->ItemName)
        {
                MmFreeMemory(SectionItem);
@@ -226,7 +226,7 @@ BOOL IniAddSettingValueToSection(ULONG SectionId, PCHAR SettingName, PCHAR Setti
        }
 
        // Allocate the setting value buffer
        }
 
        // Allocate the setting value buffer
-       SectionItem->ItemValue = MmAllocateMemory(strlen(SettingValue));
+       SectionItem->ItemValue = MmAllocateMemory(strlen(SettingValue) + 1);
        if (!SectionItem->ItemValue)
        {
                MmFreeMemory(SectionItem->ItemName);
        if (!SectionItem->ItemValue)
        {
                MmFreeMemory(SectionItem->ItemName);