File: readline83-002.diff

package info (click to toggle)
readline 8.3-4
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 9,776 kB
  • sloc: ansic: 30,409; sh: 6,600; perl: 4,105; makefile: 1,856
file content (34 lines) | stat: -rw-r--r-- 1,234 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
			   READLINE PATCH REPORT
			   =====================

Readline-Release: 8.3
Patch-ID: readline83-002

Bug-Reported-by:	Tobias Powalowski <tobias.powalowski@pm.me>
Bug-Reference-ID:	<6465ed69-d2da-4277-92cf-1046bc97ca60@pm.me>
Bug-Reference-URL:	https://lists.gnu.org/archive/html/bug-readline/2025-07/msg00005.html

Bug-Description:

If an application calls rl_save_prompt, which sets rl_prompt to NULL, 
without calling rl_set_prompt to set it to a new value, readline redisplay
can dereference a NULL pointer.

--- a/display.c
+++ b/display.c
@@ -783,7 +783,7 @@ _rl_optimize_redisplay (void)
 
 /* Useful shorthand used by rl_redisplay, update_line, rl_move_cursor_relative */
 #define INVIS_FIRST()	(local_prompt_invis_chars[0])
-#define WRAP_OFFSET(line, offset)  ((line <= prompt_last_screen_line) ? local_prompt_invis_chars[line] : 0)
+#define WRAP_OFFSET(line, offset)  ((line <= prompt_last_screen_line && local_prompt_invis_chars) ? local_prompt_invis_chars[line] : 0)
 
 #define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
 #define VIS_LLEN(l)	((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-1
+2