changeset 2551:c30f0a288ccf

Fix out of bounds buffer access when loading a cue sheet > 2048 bytes via file browser or drag and drop
author Michael Pavone <pavone@retrodev.com>
date Wed, 08 Jan 2025 23:30:07 -0800
parents e3575bb1273a
children f35109ae45f6
files system.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/system.c	Sat Jan 04 22:49:06 2025 -0800
+++ b/system.c	Wed Jan 08 23:30:07 2025 -0800
@@ -233,12 +233,14 @@
 	romclose(f);
 	if (!strcasecmp(dst->extension, "cue")) {
 		if (parse_cue(dst)) {
+			ret = dst->size;
 			if (stype) {
 				*stype = SYSTEM_SEGACD;
 			}
 		}
 	} else if (!strcasecmp(dst->extension, "toc")) {
 		if (parse_toc(dst)) {
+			ret = dst->size;
 			if (stype) {
 				*stype = SYSTEM_SEGACD;
 			}