代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/c-ares 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6d6cd5daf63b812734343bd020677829b13db2ac Mon Sep 17 00:00:00 2001
From: Fionn Fitzmaurice <1897918+fionn@users.noreply.github.com>
Date: Fri, 3 Jul 2020 07:39:54 +0800
Subject: [PATCH] Avoid buffer overflow in RC4 loop comparison (#336)
The rc4 function iterates over a buffer of size buffer_len who's maximum
value is INT_MAX with a counter of type short that is not guaranteed to
have maximum size INT_MAX.
In circumstances where short is narrower than int and where buffer_len
is larger than the maximum value of a short, it may be possible to loop
infinitely as counter will overflow and never be greater than or equal
to buffer_len.
The solution is to make the comparison be between types of equal width.
This commit defines counter as an int.
Fix By: Fionn Fitzmaurice (@fionn)
---
ares_query.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ares_query.c b/ares_query.c
index b38b8a6..5bbb2f5 100644
--- a/ares_query.c
+++ b/ares_query.c
@@ -45,7 +45,7 @@ static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
unsigned char y;
unsigned char* state;
unsigned char xorIndex;
- short counter;
+ int counter;
x = key->x;
y = key->y;
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。