mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-26 21:54:33 +08:00
mgmt-tester: Fix buffer overrun
Error: OVERRUN (CWE-119): [#def56] [important]
tools/mgmt-tester.c:12674:2: overrun-local:
Overrunning array "buf" of 513 bytes at byte offset 513 using
index "read + 1" (which evaluates to 513).
12672| }
12673| /* Make sure buf is nul-terminated */
12674|-> buf[read + 1] = '\0';
12675|
12676| /* Verify if all devcoredump header fields are present */
Fixes: 49d0656069
("mgmt-tester: Fix non-nul-terminated string")
This commit is contained in:
parent
24cf049395
commit
aa54087f13
@ -12671,7 +12671,7 @@ static void verify_devcd(void *user_data)
|
||||
return;
|
||||
}
|
||||
/* Make sure buf is nul-terminated */
|
||||
buf[read + 1] = '\0';
|
||||
buf[read] = '\0';
|
||||
|
||||
/* Verify if all devcoredump header fields are present */
|
||||
line = strtok_r(buf, delim, &saveptr);
|
||||
|
Loading…
Reference in New Issue
Block a user