Skip to content

Commit

Permalink
Settings: Fixed out-of-bounds read when .ini file on disk is empty. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 authored and ocornut committed May 29, 2022
1 parent 697ce2d commit e23c5ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Other Changes:
always lead to menu closure. Fixes using items that are not MenuItem() or BeginItem() at the root
level of a popup with a child menu opened.
- Stack Tool: Added option to copy item path to clipboard. (#4631)
- Settings: Fixed out-of-bounds read when .ini file on disk is empty. (#5351) [@quantum5]
- DrawList: Fixed PathArcTo() emitting terminating vertices too close to arc vertices. (#4993) [@thedmd]
- DrawList: Fixed texture-based anti-aliasing path with RGBA textures (#5132, #3245) [@cfillion]
- DrawList: Fixed divide-by-zero or glitches with Radius/Rounding values close to zero. (#5249, #5293, #3491)
Expand Down
3 changes: 2 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11652,7 +11652,8 @@ void ImGui::LoadIniSettingsFromDisk(const char* ini_filename)
char* file_data = (char*)ImFileLoadToMemory(ini_filename, "rb", &file_data_size);
if (!file_data)
return;
LoadIniSettingsFromMemory(file_data, (size_t)file_data_size);
if (file_data_size > 0)
LoadIniSettingsFromMemory(file_data, (size_t)file_data_size);
IM_FREE(file_data);
}

Expand Down

0 comments on commit e23c5ed

Please sign in to comment.