1 Star 0 Fork 34

tzing_t/wireshark

forked from src-openEuler/wireshark 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CVE-2023-4513-1.patch 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
From 863f6c3dc760ab770a7b31b33e9c769868e4289b Mon Sep 17 00:00:00 2001
From: John Thacker <[email protected]>
Date: Thu, 10 Aug 2023 01:19:21 -0400
Subject: [PATCH] wmem: Fix leak in block_fast when realloc'ing jumbo blocks
In block fast wmem_allocator is used, keep the double linked
list of jumbo blocks accurate by pointing the prev pointer of
the old head (if it exists) to the newly allocated jumbo block.
This prevents a leak if a jumbo block which is not the most
recently added jumbo block is realloc'ed. If the prev pointer
isn't set properly, then all the jumbo blocks added afterwards
will be lost from the list and leaked.
Fix #19259
(cherry picked from commit d086f2733bc611eb310aafec51bd28d44166fa42)
---
wsutil/wmem/wmem_allocator_block_fast.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/wsutil/wmem/wmem_allocator_block_fast.c b/wsutil/wmem/wmem_allocator_block_fast.c
index bdb8c2f75dc..117e9df6193 100644
--- a/wsutil/wmem/wmem_allocator_block_fast.c
+++ b/wsutil/wmem/wmem_allocator_block_fast.c
@@ -97,6 +97,9 @@ wmem_block_fast_alloc(void *private_data, const size_t size)
size + WMEM_JUMBO_HEADER_SIZE + WMEM_CHUNK_HEADER_SIZE);
block->next = allocator->jumbo_list;
+ if (block->next) {
+ block->next->prev = block;
+ }
block->prev = NULL;
allocator->jumbo_list = block;
--
GitLab
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tzing_t/wireshark.git
[email protected]:tzing_t/wireshark.git
tzing_t
wireshark
wireshark
master

搜索帮助