1
0
Fork 0
forked from len0rd/rockbox

[BugFix, Asan] skin_tokens.c get_dir path name underrun

preventing multiple slashes reads prior to the buffer by 1 byte
when only a single slash exists

Change-Id: I1ce1dc8d754bf1c8798dc49f396c9142e4a6e49c
This commit is contained in:
William Wilgus 2024-05-13 17:16:16 -04:00 • committed by William Wilgus
parent 556b466f05
commit 9d3b012ac0

View file

@ -107,7 +107,7 @@ char* get_dir(char* buf, int buf_size, const char* path, int level)
break;
last_sep = sep - 1;
if (*last_sep != '/') /* ignore multiple separators */
if (last_sep < path || *last_sep != '/') /* ignore multiple separators */
level--;
}
}