]> git.ipfire.org Git - thirdparty/readline.git/commitdiff
Readline-8.3 patch 2: fix crash if the calling application sets rl_prompt to NULL...
authorChet Ramey <chet.ramey@case.edu>
Wed, 10 Dec 2025 16:34:13 +0000 (11:34 -0500)
committerChet Ramey <chet.ramey@case.edu>
Wed, 10 Dec 2025 16:34:13 +0000 (11:34 -0500)
display.c
patchlevel

index 9aa8c7b50be798be1f327004b5811e95939e2133..edb525d31090f9274462fef48055882bb10c3098 100644 (file)
--- 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]))
index fdf474049fce8501d87e7b8fa7cf2b72cab0ad9b..7cbda82ded86fa174ee44dba637d5fa80815bfdc 100644 (file)
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-1
+2