view src/readline-0-002-avoid-possible-crash-when-tryin.patch @ 6989:5f2c92da4d9c

readline: update to 8.1 patch level 7 Add upstream patches for readline. * readline-3-fd_set.patch: Remove hunk that is part of readline-0-004. * dist-files.mk: Update list with new patches.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 01 Dec 2023 19:47:25 +0100
parents
children 142471155843
line wrap: on
line source

From 83de95eaba5debdf544d0ef43cf88de3bc5cd7dd Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 17 Nov 2023 16:00:59 -0500
Subject: [PATCH 2/7] Readline-8.2 patch 2: avoid possible crash when trying to
 zero out a line buffer that's potentially not null-terminated

---
 display.c  | 7 ++-----
 patchlevel | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/display.c b/display.c
index c1135ec..ad573f9 100644
--- a/display.c
+++ b/display.c
@@ -2683,11 +2683,8 @@ rl_forced_update_display (void)
   register char *temp;
 
   if (visible_line)
-    {
-      temp = visible_line;
-      while (*temp)
-	*temp++ = '\0';
-    }
+    memset (visible_line, 0, line_size);
+
   rl_on_new_line ();
   forced_display++;
   (*rl_redisplay_function) ();
diff --git a/patchlevel b/patchlevel
index fdf4740..7cbda82 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-1
+2
-- 
2.38.0.windows.1