Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Sep 2019 21:49:01 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352025 - head/sbin/mount_fusefs
Message-ID:  <201909072149.x87Ln1gM007922@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909072149.x87Ln1gM007922>