Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/fsck_udf Prevent reading beyond the early_vat_location



details:   https://anonhg.NetBSD.org/src/rev/c385f4a3d0bd
branches:  trunk
changeset: 365741:c385f4a3d0bd
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Fri Apr 22 21:00:28 2022 +0000

description:
Prevent reading beyond the early_vat_location

diffstat:

 sbin/fsck_udf/main.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 1f240c508af7 -r c385f4a3d0bd sbin/fsck_udf/main.c
--- a/sbin/fsck_udf/main.c      Fri Apr 22 20:56:46 2022 +0000
+++ b/sbin/fsck_udf/main.c      Fri Apr 22 21:00:28 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.8 2022/04/22 20:56:46 reinoud Exp $ */
+/*     $NetBSD: main.c,v 1.9 2022/04/22 21:00:28 reinoud Exp $ */
 
 /*
  * Copyright (c) 2022 Reinoud Zandijk
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.8 2022/04/22 20:56:46 reinoud Exp $");
+__RCSID("$NetBSD: main.c,v 1.9 2022/04/22 21:00:28 reinoud Exp $");
 #endif /* not lint */
 
 #include <stdio.h>
@@ -2148,6 +2148,8 @@
                } else {
                        late_vat_loc = early_vat_loc - 1;
                }
+               if (early_vat_loc == first_possible_vat_location)
+                       break;
                early_vat_loc = first_possible_vat_location;
                if (late_vat_loc > VAT_BLK)
                        early_vat_loc = MAX(early_vat_loc, late_vat_loc - VAT_BLK);



Home | Main Index | Thread Index | Old Index