view src/readline-0-002-avoid-possible-crash-when-tryin.patch @ 7186:19a46de50b18 default tip @

* src/jasper.mk: update to v4.2.4
author John Donoghue <john.donoghue@ieee.org>
date Thu, 02 May 2024 09:22:30 -0400
parents 142471155843
children
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 02/10] 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