Source-Changes-HG archive

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

[src/trunk]: src/sbin/gpt Do not try to close a NULL gpt. Fixes the core dump...



details:   https://anonhg.NetBSD.org/src/rev/94c746a53de9
branches:  trunk
changeset: 999835:94c746a53de9
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jun 20 10:41:58 2019 +0000

description:
Do not try to close a NULL gpt. Fixes the core dump part of PR bin/54312

diffstat:

 sbin/gpt/gpt.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r d826b0c348bf -r 94c746a53de9 sbin/gpt/gpt.c
--- a/sbin/gpt/gpt.c    Thu Jun 20 10:29:53 2019 +0000
+++ b/sbin/gpt/gpt.c    Thu Jun 20 10:41:58 2019 +0000
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.77 2019/01/27 13:16:05 martin Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.78 2019/06/20 10:41:58 martin Exp $");
 #endif
 
 #include <sys/param.h>
@@ -590,6 +590,9 @@
 gpt_close(gpt_t gpt)
 {
 
+       if (gpt == NULL)
+               return;
+
        if (!(gpt->flags & GPT_MODIFIED) || !(gpt->flags & GPT_SYNC))
                goto out;
 



Home | Main Index | Thread Index | Old Index