Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Ignore corrupt GPTs
details: https://anonhg.NetBSD.org/src/rev/6baecfa845a0
branches: trunk
changeset: 452237:6baecfa845a0
user: martin <martin%NetBSD.org@localhost>
date: Sun Jun 23 11:47:08 2019 +0000
description:
Ignore corrupt GPTs
diffstat:
usr.sbin/sysinst/gpt.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diffs (22 lines):
diff -r ff3c04914f41 -r 6baecfa845a0 usr.sbin/sysinst/gpt.c
--- a/usr.sbin/sysinst/gpt.c Sun Jun 23 11:31:10 2019 +0000
+++ b/usr.sbin/sysinst/gpt.c Sun Jun 23 11:47:08 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpt.c,v 1.1 2019/06/12 06:20:17 martin Exp $ */
+/* $NetBSD: gpt.c,v 1.2 2019/06/23 11:47:08 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -334,6 +334,12 @@
}
free(textbuf);
+ /* If the GPT was not complete (e.g. truncated image), barf */
+ if (disk_size <= 0) {
+ free(parts);
+ return NULL;
+ }
+
parts->dp.pscheme = &gpt_parts;
parts->dp.disk = dev;
parts->dp.disk_start = start;
Home |
Main Index |
Thread Index |
Old Index