commit f07775a9a2e9c8f7dd0b78a1404ac67aaa3d697a
parent 60080d8fe835f9a19227f3f2e32ed4b332a551f4
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Fri, 17 Feb 2023 21:39:14 +0000
(file device) Fix buffer overflow.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/devices/file.c b/src/devices/file.c
@@ -65,7 +65,7 @@ static Uint16
get_entry(char *p, Uint16 len, const char *pathname, const char *basename, int fail_nonzero)
{
struct stat st;
- if(len < strlen(basename) + 7)
+ if(len < strlen(basename) + 8)
return 0;
if(stat(pathname, &st))
return fail_nonzero ? sprintf(p, "!!!! %s\n", basename) : 0;