projects
/
dosemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27d9d4d
)
Fixed potential path truncation in case-insensitive file lookup
author
Robert Pengelly
<robertapengelly@hotmail.com>
Tue, 20 Oct 2026 10:24:14 +0000
(11:24 +0100)
committer
Robert Pengelly
<robertapengelly@hotmail.com>
Tue, 20 Oct 2026 10:24:14 +0000
(11:24 +0100)
interrupts.c
patch
|
blob
|
history
diff --git
a/interrupts.c
b/interrupts.c
index 77c3fcbe5c5990e933f2f24697ff0e381718c192..68e19a58fcd015cbc68d6f0448cb2f2ad49cf869 100644
(file)
--- a/
interrupts.c
+++ b/
interrupts.c
@@
-3246,7
+3246,6
@@
FILE *dos_fopen_case_insensitive (const char *path, const char *mode) {
DIR *d;
dos_split_dir_pattern (path, dir, sizeof (dir), name, sizeof (name));
-
d = opendir (dir[0] ? dir : ".");
if (!d) {
@@
-3257,10
+3256,11
@@
FILE *dos_fopen_case_insensitive (const char *path, const char *mode) {
if (strcasecmp (ent->d_name, name) == 0) {
- char full[512];
- snprintf (full, sizeof (full), "%s/%s", dir[0] ? dir : ".", ent->d_name);
+ char full[520];
+ snprintf (full, sizeof (full), "%s/%s", dir[0] ? dir : ".", ent->d_name);
closedir (d);
+
return fopen (full, mode);
}