From 992214a67aee8b2e70526ee60f8f2fe4a8e8976d Mon Sep 17 00:00:00 2001 From: riccardom Date: Thu, 22 Jan 2009 20:49:13 +0000 Subject: [PATCH] Fix a buffer overflow :) --- desmume/src/NDSSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index e1def3466..b555530ac 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -502,7 +502,7 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize, memcpy(buf+strlen(buf), &header->makerCode, 2); } INFO("\nROM serial: %s\n\n", buf); - strcpy(ROMserial, buf); + strncpy(ROMserial, buf, sizeof(ROMserial)); return i; }