-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import Debian changes 2:8.2.3995-1ubuntu2.19
vim (2:8.2.3995-1ubuntu2.19) jammy-security; urgency=medium * SECURITY UPDATE: buffer overflow - debian/patches/CVE-2024-43802.patch: check buflen before advancing offset. - CVE-2024-43802
- Loading branch information
1 parent
73957f4
commit 6c965a2
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Description: heap-buffer-overflow in ins_typebuf | ||
Problem: heap-buffer-overflow in ins_typebuf | ||
(SuyueGuo) | ||
Solution: When flushing the typeahead buffer, validate that there | ||
is enough space left | ||
Author: Christian Brabandt <cb@256bit.org> | ||
Origin: upstream, https://github.com/vim/vim/commit/322ba9108612bead5eb | ||
--- | ||
|
||
Index: vim-8.2.3995/src/getchar.c | ||
=================================================================== | ||
--- vim-8.2.3995.orig/src/getchar.c | ||
+++ vim-8.2.3995/src/getchar.c | ||
@@ -432,9 +432,18 @@ flush_buffers(flush_buffers_T flush_type | ||
|
||
if (flush_typeahead == FLUSH_MINIMAL) | ||
{ | ||
- // remove mapped characters at the start only | ||
- typebuf.tb_off += typebuf.tb_maplen; | ||
- typebuf.tb_len -= typebuf.tb_maplen; | ||
+ // remove mapped characters at the start only, | ||
+ // but only when enough space left in typebuf | ||
+ if (typebuf.tb_off + typebuf.tb_maplen >= typebuf.tb_buflen) | ||
+ { | ||
+ typebuf.tb_off = MAXMAPLEN; | ||
+ typebuf.tb_len = 0; | ||
+ } | ||
+ else | ||
+ { | ||
+ typebuf.tb_off += typebuf.tb_maplen; | ||
+ typebuf.tb_len -= typebuf.tb_maplen; | ||
+ } | ||
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) | ||
if (typebuf.tb_len == 0) | ||
typebuf_was_filled = FALSE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters