9 Star 0 Fork 19

src-openEuler/libssh2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Add-NULL-pointer-check-for-outlen-before-use-1109.patch 891 Bytes
一键复制 编辑 原始数据 按行查看 历史
bitianyuan 提交于 2024-11-06 15:51 . backport some upstream patches
From 724effcb47ebb713d3ef1776684b8f6407b4b6a5 Mon Sep 17 00:00:00 2001
From: ren mingshuai <[email protected]>
Date: Sat, 1 Jul 2023 01:34:44 +0800
Subject: [PATCH] Add NULL pointer check for outlen before use (#1109)
Before assigning a value to the outlen, we need to check whether it is NULL.
Credit: Ren Mingshuai <[email protected]>
Reference:https://github.com/libssh2/libssh2/commit/724effcb47ebb713d3ef1776684b8f6407b4b6a5
Conflict:NA
---
src/misc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/misc.c b/src/misc.c
index b386e3d6..398457d4 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -901,7 +901,8 @@ int _libssh2_copy_string(LIBSSH2_SESSION *session, struct string_buf *buf,
}
}
else {
- *outlen = 0;
+ if(outlen)
+ *outlen = 0;
*outbuf = NULL;
}
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libssh2.git
[email protected]:src-openeuler/libssh2.git
src-openeuler
libssh2
libssh2
master

搜索帮助