mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Partially fix #537
if size was zero, the inputstr array could contain stack garbage
This commit is contained in:
parent
53708e64dc
commit
47312797e2
@ -920,7 +920,9 @@ bool ShowDataPrompt(u8* data, u32* size, const char *format, ...) {
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
if (*size > 64) *size = 64;
|
if (*size == 0) *inputstr = 0;
|
||||||
|
else if (*size > 64) *size = 64;
|
||||||
|
|
||||||
for (u32 i = 0; i < *size; i++)
|
for (u32 i = 0; i < *size; i++)
|
||||||
snprintf(inputstr + (2*i), 128 + 1 - (2*i), "%02X", (unsigned int) data[i]);
|
snprintf(inputstr + (2*i), 128 + 1 - (2*i), "%02X", (unsigned int) data[i]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user