aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mount_util.c
diff options
context:
space:
mode:
authorBernd Schubert <bschubert@ddn.com>2024-06-25 07:05:19 +0200
committerBernd Schubert <bernd.schubert@fastmail.fm>2024-06-25 11:34:16 +0200
commitf88e08f34d2d4f398f23797707e1c50cd306e405 (patch)
tree3caf402617d3eab28d814b9791e2bdd6bd35c755 /lib/mount_util.c
parent09e6583b54b7cd126869d41908e28cd0e8f44e45 (diff)
downloadlibfuse-f88e08f34d2d4f398f23797707e1c50cd306e405.tar.gz
Add nullptr check in fuse_session_mount
The pointer did not have any sanity check. Addresses https://github.com/libfuse/libfuse/issues/979
Diffstat (limited to 'lib/mount_util.c')
-rw-r--r--lib/mount_util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/mount_util.c b/lib/mount_util.c
index dd32276..02a84ef 100644
--- a/lib/mount_util.c
+++ b/lib/mount_util.c
@@ -359,6 +359,11 @@ int fuse_mnt_parse_fuse_fd(const char *mountpoint)
int fd = -1;
int len = 0;
+ if (mountpoint == NULL) {
+ fprintf(stderr, "Invalid null-ptr mount-point!\n");
+ return -1;
+ }
+
if (sscanf(mountpoint, "/dev/fd/%u%n", &fd, &len) == 1 &&
len == strlen(mountpoint)) {
return fd;