mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 03:49:02 +00:00
mount_fusefs: fix a segfault on memory allocation failure
Reported by: Coverity Coverity CID: 1354188 MFC after: 4 days Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
dd21a9163c
commit
8c50ee012f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352025
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user