Closed wangshao1 closed 2 weeks ago
The changes primarily address a heap-buffer-overflow issue in the InfoCmd::InfoKeyspace
function within the src/pika_admin.cc
file. This is achieved by adjusting conditional statements, modifying comparisons for key_infos
size, and updating relevant constants across various files. These updates ensure that memory allocation is correctly handled, thereby preventing process crashes.
File(s) | Change Summary |
---|---|
src/pika_admin.cc |
Adjusted async statistics messages conditions, modified key_infos size comparison, and slightly adjusted output messages. |
.../base_value_format.h |
Added new constant DataTypeNum initialized with the integer value of kNones . |
src/storage/src/redis.cc |
Updated the SetCompactRangeOptions and ScanKeyNum functions to use DataTypeNum for key_infos resizing. |
src/storage/src/storage.cc |
Changed the Storage class's GetKeyNum method to use DataTypeNum for resizing key_infos . |
Objective | Addressed | Explanation |
---|---|---|
Fix heap-buffer-overflow error when executing dbsize on macOS environments (#2747). |
✅ | |
Adjust InfoCmd::InfoKeyspace to ensure correct memory allocation and avoid crashes (#2747). |
✅ |
In code's deep dance and memory's flow, A buffer overflow had room to grow. But with careful tweaks and constant clear, Stability reigns, no need to fear. Cheers to lines both fine and neat, The Pika codebase feels complete! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
this pr fix https://github.com/OpenAtomFoundation/pika/issues/2747
Summary by CodeRabbit
Refactor
DataTypeNum
for key information sizing across multiple components.Bug Fixes