Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: hlgroup: fix in 52783 was incomplete, add same check in scangroup()
- X-seq: zsh-workers 54555
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: hlgroup: fix in 52783 was incomplete, add same check in scangroup()
- Date: Thu, 14 May 2026 17:20:05 +0200
- Archived-at: <https://zsh.org/workers/54555>
- In-reply-to: <20260514152019.27243-1-mikachu@gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20260514152019.27243-1-mikachu@gmail.com>
% typeset -A .zle.hlgroups
% zmodload -i zsh/hlgroup
% : ${.zle.hlgroups[select]}
% print ${(k).zle.esc}
zsh: segmentation fault
Also add check on !hlg too for paranoia, not sure if that can actually
happen, but getgroup has the same check.
---
Src/Modules/hlgroup.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Src/Modules/hlgroup.c b/Src/Modules/hlgroup.c
index 1dc6ac2ef0..819b546960 100644
--- a/Src/Modules/hlgroup.c
+++ b/Src/Modules/hlgroup.c
@@ -124,6 +124,8 @@ scangroup(ScanFunc func, int flags, int sgr)
PM_TYPE(v->pm->node.flags) != PM_HASHED)
return;
hlg = v->pm->gsu.h->getfn(v->pm);
+ if (!hlg)
+ return;
memset((void *)&pm, 0, sizeof(struct param));
pm.node.flags = PM_SCALAR;
@@ -131,6 +133,8 @@ scangroup(ScanFunc func, int flags, int sgr)
for (i = 0; i < hlg->hsize; i++)
for (hn = hlg->nodes[i]; hn; hn = hn->next) {
+ if (((Param) hn)->node.flags & PM_UNSET)
+ continue;
pm.u.str = convertattr(((Param) hn)->u.str, sgr);
pm.node.nam = hn->nam;
func(&pm.node, flags);
--
2.38.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author