6 Star 0 Fork 14

src-openEuler/fuse3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-add-nullptr-check-in-fuse_session_mount.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
yanshuai 提交于 2024-08-27 02:20 . add nullptr check in fuse_session_mount
From f88e08f34d2d4f398f23797707e1c50cd306e405 Mon Sep 17 00:00:00 2001
From: Bernd Schubert <bschubert@ddn.com>
Date: Tue, 25 Jun 2024 07:05:19 +0200
Subject: [PATCH] Add nullptr check in fuse_session_mount
The pointer did not have any sanity check.
Addresses https://github.com/libfuse/libfuse/issues/979
---
lib/fuse_lowlevel.c | 5 +++++
lib/mount_util.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index fdef193..47c3065 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -3145,6 +3145,11 @@ int fuse_session_mount(struct fuse_session *se, const char *mountpoint)
{
int fd;
+ if (mountpoint == NULL) {
+ fuse_log(FUSE_LOG_ERR, "Invalid null-ptr mountpoint!\n");
+ return -1;
+ }
+
/*
* Make sure file descriptors 0, 1 and 2 are open, otherwise chaos
* would ensue.
diff --git a/lib/mount_util.c b/lib/mount_util.c
index 8027a2e..c90ba92 100644
--- a/lib/mount_util.c
+++ b/lib/mount_util.c
@@ -363,6 +363,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;
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/fuse3.git
git@gitee.com:src-openeuler/fuse3.git
src-openeuler
fuse3
fuse3
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385