mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-25 13:14:14 +08:00
Off-by-one error in uses_rfcomm
Variable len could be assigned to PATH_MAX + 1 length (returned from readlink) and this variable is used as index to array link of size only PATH_MAX + 1.
This commit is contained in:
parent
7af9f8687e
commit
b52dc7e907
@ -104,7 +104,7 @@ static int uses_rfcomm(char *path, char *dev)
|
||||
|
||||
while ((de = readdir(dir)) != NULL) {
|
||||
char link[PATH_MAX + 1];
|
||||
int len = readlink(de->d_name, link, sizeof(link));
|
||||
int len = readlink(de->d_name, link, PATH_MAX);
|
||||
if (len > 0) {
|
||||
link[len] = 0;
|
||||
if (strstr(link, dev)) {
|
||||
|
Loading…
Reference in New Issue
Block a user