1 Star 0 Fork 10

orange-snn/gpm

forked from src-openEuler/gpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-signedness-issue.patch 846 Bytes
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:51 . Package init
From 4337fd9fc2d2ea83654f2ca69245503730231ac3 Mon Sep 17 00:00:00 2001
From: iljavs <ivansprundel@ioactive.com>
Date: Mon, 27 Jun 2016 01:17:57 -0700
Subject: [PATCH 21/21] fix signedness issue
This commit fixes a signedness issue, where a negative vc coming from a malicious client could possibly cause memory corruption.
---
src/daemon/processconn.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/daemon/processconn.c b/src/daemon/processconn.c
index a5839a3..e92fa63 100644
--- a/src/daemon/processconn.c
+++ b/src/daemon/processconn.c
@@ -67,7 +67,8 @@ int processConn(int fd)
return -1;
}
- if((vc = request->vc) > MAX_VC) {
+ vc = request->vc;
+ if(vc > MAX_VC || vc < 0) {
gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC);
free(info);
close(newfd);
--
2.19.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/orange-snn/gpm.git
git@gitee.com:orange-snn/gpm.git
orange-snn
gpm
gpm
master

搜索帮助