From: Robert Pengelly Date: Tue, 20 Oct 2026 10:24:14 +0000 (+0100) Subject: Fixed potential path truncation in case-insensitive file lookup X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=1092462b2510b96e4c0a3bcf48c5dc6afcba9f73;p=dosemu.git Fixed potential path truncation in case-insensitive file lookup --- diff --git a/interrupts.c b/interrupts.c index 77c3fcb..68e19a5 100644 --- 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); }