aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount_fusefs
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2019-09-07 21:49:01 +0000
committerAlan Somers <asomers@FreeBSD.org>2019-09-07 21:49:01 +0000
commit8c50ee012fbc71aa640ed437d7fe0891793b4fd7 (patch)
tree863b3e488168d3968b7246e8150b6b02814690ce /sbin/mount_fusefs
parentdd21a9163cbe2711e93c231e4fa7d3c3b9fec06e (diff)
downloadsrc-8c50ee012fbc71aa640ed437d7fe0891793b4fd7.tar.gz
src-8c50ee012fbc71aa640ed437d7fe0891793b4fd7.zip
mount_fusefs: fix a segfault on memory allocation failure
Reported by: Coverity Coverity CID: 1354188 MFC after: 4 days Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=352025
Diffstat (limited to 'sbin/mount_fusefs')
-rw-r--r--sbin/mount_fusefs/mount_fusefs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/mount_fusefs/mount_fusefs.c b/sbin/mount_fusefs/mount_fusefs.c
index 3103d36fa332..33667c035e32 100644
--- a/sbin/mount_fusefs/mount_fusefs.c
+++ b/sbin/mount_fusefs/mount_fusefs.c
@@ -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;