bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] spell-correct-word: avoid inf loop with neg arg


From: Grisha Levit
Subject: [PATCH] spell-correct-word: avoid inf loop with neg arg
Date: Tue, 21 May 2024 22:41:45 -0400

bash --norc -in <<< $'A \e-\cXs'

---
 bashline.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bashline.c b/bashline.c
index 528f56e0..0a4e280e 100644
--- a/bashline.c
+++ b/bashline.c
@@ -1336,6 +1336,9 @@ bash_spell_correct_shellword (int count, int key)
   int wbeg, wend;
   char *text, *newdir;
 
+  if (count < 0)
+    count = -count;
+
   while (count)
     {
       bash_backward_shellword (1, key);
-- 
2.45.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]