From 37a1e4af7ddf28c8d27db0368d1810fcda96dae1 Mon Sep 17 00:00:00 2001 From: Heon Jeong Date: Sat, 25 Oct 2025 20:19:48 -0700 Subject: 54008: infinite loop running completion with specific multibyte character and locale combination --- ChangeLog | 3 +++ Src/Zle/compmatch.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf6eef153..c5fabdea0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2025-11-12 Oliver Kiddle + * Heon Jeong: 54008: Src/Zle/compmatch.c: infinite loop running + completion with specific multibyte character and locale combination + * Christopher Bock: 54026: Completion/Debian/Command/_uscan: update uscan options diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index b58bd1f05..bc82ff4d0 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -2487,10 +2487,12 @@ join_psfx(Cline ot, Cline nt, Cline *orest, Cline *nrest, int sfx) /* We first get the length of the prefix equal in both strings. */ if (o->flags & CLF_LINE) { - if ((len = sub_match(&md, o->line, o->llen, sfx)) != o->llen) { + if ((len = sub_match(&md, o->line, o->llen, sfx)) != o->llen + && len >= 0) { join = 1; line = 1; slen = &(o->llen); sstr = &(o->line); } - } else if ((len = sub_match(&md, o->word, o->wlen, sfx)) != o->wlen) { + } else if ((len = sub_match(&md, o->word, o->wlen, sfx)) != o->wlen + && len >= 0) { if (o->line) { memcpy(&md, &omd, sizeof(struct cmdata)); o->flags |= CLF_LINE | CLF_DIFF; -- cgit v1.2.3-70-g09d2