From 1fb4d2be4dacbf68e1506f78fd3eb77c3aae40e4 Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Mon, 6 Aug 2018 00:24:15 +0100 Subject: [PATCH] GBA: Zero DebugString buffer when handling messages --- src/gba/gba.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gba/gba.c b/src/gba/gba.c index 45025f228..4c96d7129 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -525,6 +525,7 @@ void GBADebug(struct GBA* gba, uint16_t flags) { level &= 0x1F; char oolBuf[0x101]; strncpy(oolBuf, gba->debugString, sizeof(gba->debugString)); + memset(gba->debugString, 0, sizeof(gba->debugString)); oolBuf[0x100] = '\0'; mLog(_mLOG_CAT_GBA_DEBUG(), level, "%s", oolBuf); }