Module Name:    src
Committed By:   martin
Date:           Thu Jun 20 10:41:58 UTC 2019

Modified Files:
        src/sbin/gpt: gpt.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sbin/gpt/gpt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.77 src/sbin/gpt/gpt.c:1.78
--- src/sbin/gpt/gpt.c:1.77	Sun Jan 27 13:16:05 2019
+++ src/sbin/gpt/gpt.c	Thu Jun 20 10:41:58 2019
@@ -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 @@ void
 gpt_close(gpt_t gpt)
 {
 
+	if (gpt == NULL)
+		return;
+
 	if (!(gpt->flags & GPT_MODIFIED) || !(gpt->flags & GPT_SYNC))
 		goto out;
 

Reply via email to