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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user