diff mbox series

package/readline: fix a segfault in connmanctl

Message ID af42-dxArYlXGip6@waldemar-brodkorb.de
State Accepted
Headers show
Series package/readline: fix a segfault in connmanctl | expand

Commit Message

Waldemar Brodkorb May 8, 2026, 7:18 p.m. UTC
Reported via IRC in #buildroot connmanctl segfaults randomly
on startup and keyboard input is not echoed back.

Could be reproduced with Raspberry PI4 (32 Bit) defconfig and glibc
based userland.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 ...ch-2-fix-crash-if-the-calling-applic.patch | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch

Comments

Arnout Vandecappelle May 30, 2026, 9:49 a.m. UTC | #1
On 08/05/2026 21:18, Waldemar Brodkorb wrote:
> Reported via IRC in #buildroot connmanctl segfaults randomly
> on startup and keyboard input is not echoed back.
> 
> Could be reproduced with Raspberry PI4 (32 Bit) defconfig and glibc
> based userland.
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   ...ch-2-fix-crash-if-the-calling-applic.patch | 22 +++++++++++++++++++
>   1 file changed, 22 insertions(+)
>   create mode 100644 package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
> 
> diff --git a/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch b/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
> new file mode 100644
> index 0000000000..50df37fd4a
> --- /dev/null
> +++ b/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
> @@ -0,0 +1,22 @@
> +From 9a3a2388e376eb2b43a2fe3dd8c5ce6e62ee3cc0 Mon Sep 17 00:00:00 2001
> +From: Chet Ramey <chet.ramey@case.edu>
> +Date: Wed, 10 Dec 2025 11:34:13 -0500
> +Subject: [PATCH] Readline-8.3 patch 2: fix crash if the calling application
> + sets rl_prompt to NULL without setting a new value
> +
> +Upstream: https://cgit.git.savannah.gnu.org/cgit/readline.git/commit/?id=9a3a2388e376eb2b43a2fe3dd8c5ce6e62ee3cc0
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +
> +diff --git a/display.c b/display.c
> +index 9aa8c7b..edb525d 100644
> +--- 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]))
Thomas Perale June 5, 2026, 12:49 p.m. UTC | #2
In reply of:
> Reported via IRC in #buildroot connmanctl segfaults randomly
> on startup and keyboard input is not echoed back.
> 
> Could be reproduced with Raspberry PI4 (32 Bit) defconfig and glibc
> based userland.
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

Applied to 2026.02.x. Thanks

> ---
>  ...ch-2-fix-crash-if-the-calling-applic.patch | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
>  create mode 100644 package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
> 
> diff --git a/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch b/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
> new file mode 100644
> index 0000000000..50df37fd4a
> --- /dev/null
> +++ b/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
> @@ -0,0 +1,22 @@
> +From 9a3a2388e376eb2b43a2fe3dd8c5ce6e62ee3cc0 Mon Sep 17 00:00:00 2001
> +From: Chet Ramey <chet.ramey@case.edu>
> +Date: Wed, 10 Dec 2025 11:34:13 -0500
> +Subject: [PATCH] Readline-8.3 patch 2: fix crash if the calling application
> + sets rl_prompt to NULL without setting a new value
> +
> +Upstream: https://cgit.git.savannah.gnu.org/cgit/readline.git/commit/?id=9a3a2388e376eb2b43a2fe3dd8c5ce6e62ee3cc0
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +
> +diff --git a/display.c b/display.c
> +index 9aa8c7b..edb525d 100644
> +--- 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]))
> -- 
> 2.47.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch b/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
new file mode 100644
index 0000000000..50df37fd4a
--- /dev/null
+++ b/package/readline/0002-Readline-8.3-patch-2-fix-crash-if-the-calling-applic.patch
@@ -0,0 +1,22 @@ 
+From 9a3a2388e376eb2b43a2fe3dd8c5ce6e62ee3cc0 Mon Sep 17 00:00:00 2001
+From: Chet Ramey <chet.ramey@case.edu>
+Date: Wed, 10 Dec 2025 11:34:13 -0500
+Subject: [PATCH] Readline-8.3 patch 2: fix crash if the calling application
+ sets rl_prompt to NULL without setting a new value
+
+Upstream: https://cgit.git.savannah.gnu.org/cgit/readline.git/commit/?id=9a3a2388e376eb2b43a2fe3dd8c5ce6e62ee3cc0
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff --git a/display.c b/display.c
+index 9aa8c7b..edb525d 100644
+--- 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]))