mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #2309] indirect_draw_stats: guard null FILE* in report and out-of-range Event in note/skip #2311
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2311
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2309
Author: @narekshaghoyandev
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:ubiq-indirect-draw-stats-guards📝 Commits (1)
25aed3findirect_draw_stats: guard null FILE* in report and out-of-range Event in note/skip📊 Changes
2 files changed (+58 additions, -2 deletions)
View changed files
📝
runtime/src/indirect_draw_stats.h(+5 -2)➕
runtime/test/indirect_draw_stats_test.cpp(+53 -0)📄 Description
Fixes null-pointer and out-of-bounds bugs in
runtime/src/indirect_draw_stats.h:Counts::report(std::FILE* out)againstout == nullptrbefore callingstd::fprintf(out, ...).static_cast<unsigned>(event) < 4uinnote(Event)andskip(Event, Reason)so an out-of-rangeEventcannot index pastCounts::values[4]or record a stray reason skip.runtime/test/indirect_draw_stats_test.cpp.Verification
g++ -std=c++20 -D_GLIBCXX_DEBUG -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/indirect_draw_stats_test.cpppassedg++ -std=c++20 -fsanitize=address,undefined -Wall -Wextra -Werror -pedantic -Iruntime/src runtime/test/indirect_draw_stats_test.cpppassedubiq/mainpython3 -I scripts/check_no_game_data.py runtime/src/indirect_draw_stats.h runtime/test/indirect_draw_stats_test.cppcleanClaimed in the coordination issue as: RT-INDIRECT-DRAW-STATS-BOUNDS-AND-NULL (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193658432)
AI-assisted: yes (Gemini)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.