mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
mfd: ipaq-micro: Fix out-of-bounds stack read in ipaq_micro_str
ipaq_micro_str() decodes a UTF-16LE string into an ASCII string. It copies characters to a stack buffer retstr, but fails to null-terminate it. When kstrdup() is called on retstr, it can read past the buffer into uninitialized stack memory, potentially leaking stack contents. Fix this by initializing retstr to zero. Reported-by: sashiko-bot@kernel.org Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://patch.msgid.link/aintJF4X5tWDW-Ej@google.com Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
committed by
Lee Jones
parent
b87549a9bb
commit
da3a98c941
@@ -221,7 +221,7 @@ static void ipaq_micro_eeprom_read(struct ipaq_micro *micro,
|
||||
|
||||
static char *ipaq_micro_str(u8 *wchar, u8 len)
|
||||
{
|
||||
char retstr[256];
|
||||
char retstr[256] = { 0 };
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < len / 2; i++)
|
||||
|
||||
Reference in New Issue
Block a user