Skip to content

Commit e23c5ed

Browse files
quantum5ocornut
authored andcommitted
Settings: Fixed out-of-bounds read when .ini file on disk is empty. (#5351)
1 parent 697ce2d commit e23c5ed

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Other Changes:
9494
always lead to menu closure. Fixes using items that are not MenuItem() or BeginItem() at the root
9595
level of a popup with a child menu opened.
9696
- Stack Tool: Added option to copy item path to clipboard. (#4631)
97+
- Settings: Fixed out-of-bounds read when .ini file on disk is empty. (#5351) [@quantum5]
9798
- DrawList: Fixed PathArcTo() emitting terminating vertices too close to arc vertices. (#4993) [@thedmd]
9899
- DrawList: Fixed texture-based anti-aliasing path with RGBA textures (#5132, #3245) [@cfillion]
99100
- DrawList: Fixed divide-by-zero or glitches with Radius/Rounding values close to zero. (#5249, #5293, #3491)

imgui.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11652,7 +11652,8 @@ void ImGui::LoadIniSettingsFromDisk(const char* ini_filename)
1165211652
char* file_data = (char*)ImFileLoadToMemory(ini_filename, "rb", &file_data_size);
1165311653
if (!file_data)
1165411654
return;
11655-
LoadIniSettingsFromMemory(file_data, (size_t)file_data_size);
11655+
if (file_data_size > 0)
11656+
LoadIniSettingsFromMemory(file_data, (size_t)file_data_size);
1165611657
IM_FREE(file_data);
1165711658
}
1165811659

0 commit comments

Comments
 (0)