7 Star 0 Fork 6

src-openEuler/hmdfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-bugfix-null-pointer-in-memcpy.patch 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
天宇 提交于 2023-09-14 17:21 . init: add source tar, spec, patch.
From 0aafe4b0ede1478879e188693165b24a8ae533c4 Mon Sep 17 00:00:00 2001
From: heppen <hepeng68@huawei.com>
Date: Tue, 16 May 2023 11:50:59 +0800
Subject: [PATCH 2/2] remove inline keyword for build, bugfix: null pointer in memcpy.
---
hmdfs_client.c | 3 ++-
hmdfs_share.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hmdfs_client.c b/hmdfs_client.c
index 31c1a6d38e8f..357365b15fe5 100644
--- a/hmdfs_client.c
+++ b/hmdfs_client.c
@@ -901,8 +901,9 @@ int hmdfs_send_setxattr(struct hmdfs_peer *con, const char *send_buf,
strncpy(req->buf, send_buf, path_len);
strncpy(req->buf + path_len + 1, name, name_len);
if (!value) {
- memcpy(req->buf + path_len + name_len + 2, value, size);
req->del = true;
+ } else {
+ memcpy(req->buf + path_len + name_len + 2, value, size);
}
ret = hmdfs_sendmessage_request(con, &sm);
kfree(req);
diff --git a/hmdfs_share.h b/hmdfs_share.h
index 3c055805bd6d..389e26c97c3c 100644
--- a/hmdfs_share.h
+++ b/hmdfs_share.h
@@ -49,7 +49,7 @@ int insert_share_item(struct hmdfs_share_table *st, struct qstr *relative_path,
void update_share_item(struct hmdfs_share_item *item, struct file *file,
char *cid);
bool in_share_dir(struct dentry *child_dentry);
-inline bool is_share_dir(struct inode *inode, const char *name);
+bool is_share_dir(struct inode *inode, const char *name);
int get_path_from_share_table(struct hmdfs_sb_info *sbi,
struct dentry *cur_dentry, struct path *src_path);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/hmdfs.git
git@gitee.com:src-openeuler/hmdfs.git
src-openeuler
hmdfs
hmdfs
master

搜索帮助