svn commit: r352025 - head/sbin/mount_fusefs

Alan Somers asomers at FreeBSD.org
Sat Sep 7 21:49:01 UTC 2019


Author: asomers
Date: Sat Sep  7 21:49:01 2019
New Revision: 352025
URL: https://svnweb.freebsd.org/changeset/base/352025

Log:
  mount_fusefs: fix a segfault on memory allocation failure
  
  Reported by:	Coverity
  Coverity CID:	1354188
  MFC after:	4 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sbin/mount_fusefs/mount_fusefs.c

Modified: head/sbin/mount_fusefs/mount_fusefs.c
==============================================================================
--- head/sbin/mount_fusefs/mount_fusefs.c	Sat Sep  7 21:26:56 2019	(r352024)
+++ head/sbin/mount_fusefs/mount_fusefs.c	Sat Sep  7 21:49:01 2019	(r352025)
@@ -212,6 +212,8 @@ main(int argc, char *argv[])
 							q++;
 						mv->mv_len = q - p + 1;
 						mv->mv_value = malloc(mv->mv_len);
+						if (mv->mv_value == NULL)
+							err(1, "malloc");
 						memcpy(mv->mv_value, p, mv->mv_len - 1);
 						((char *)mv->mv_value)[mv->mv_len - 1] = '\0';
 						break;


More information about the svn-src-head mailing list