Fix null terminator buffer overflow

While updating my devkitARM I found this buffer overflow:
src/input/bworld.c:56:3: warning: '__builtin_memcpy' forming offset 21 is out of the bounds [0, 20] of object 'bdata' with type 'uint8[20]' {aka 'unsigned char[20]'} [-Warray-bounds]
   strcpy((char*)&bdata[13], "SUNSOFT");
This commit is contained in:
meepingsnesroms
2018-08-15 13:29:46 -07:00
committed by GitHub
parent 67c072617b
commit a37c3bc664

View File

@@ -53,7 +53,7 @@ static void FP_FASTAPASS(2) Update(void *data, int arg) {
seq = ptr = 0;
have = 1;
strcpy((char*)bdata, (const char*)((uint8*)data + 1));
strcpy((char*)&bdata[13], "SUNSOFT");
memcpy((char*)&bdata[13], "SUNSOFT", 7);
}
}