Merge pull request #3267 from datauwu/iso9660-fix-oob

iso9660: fix 1-byte OOB read in iso-level option
(cherry picked from commit cfb3eb5497)
This commit is contained in:
Dustin L. Howett authored and Martin Matuska committed 2026-07-26 20:20:49 +02:00
1 parent 3e09b6805c
commit 6b919b34bd
1 file changed
+2 -2
@@ -1427,8 +1427,8 @@ iso9660_options(struct archive_write *a, const char *key, const char *value)
break;
case 'i':
if (strcmp(key, "iso-level") == 0) {
if (value != NULL && value[1] == '\0' &&
(value[0] >= '1' && value[0] <= '4')) {
if (value != NULL && value[0] >= '1' &&
value[0] <= '4' && value[1] == '\0') {
iso9660->opt.iso_level = value[0]-'0';
return (ARCHIVE_OK);
}