summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2021-10-30 23:33:44 +0200
committerOliver Kiddle <opk@zsh.org>2021-10-30 23:35:53 +0200
commit68c8c60eaab795353e30218a4c41615328697256 (patch)
treeb506b9f0af3557268b3f385195202a3972f26cd9
parent632fee7cdfcd234a5c7c53f17777ca18e62d82e3 (diff)
downloadzsh-68c8c60eaab795353e30218a4c41615328697256.tar.gz
zsh-68c8c60eaab795353e30218a4c41615328697256.zip
49533: add null check for preprompt functions list that could occur following an error when loading a module
-rw-r--r--ChangeLog3
-rw-r--r--Src/utils.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7721ccc8d..87d8536a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2021-10-30 Oliver Kiddle <opk@zsh.org>
+ * 49533: Src/utils.c: add null check for preprompt functions list
+ that could occur following an error when loading a module
+
* 49528: Src/Zle/comp.h, Src/Zle/compcore.c, Src/Zle/complete.c,
Completion/X/Command/_xinput, Completion/Zsh/Command/_compadd,
Doc/Zsh/compwid.yo: allow multiple -D options to compadd
diff --git a/Src/utils.c b/Src/utils.c
index a74c8bd2c..ed3690172 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1378,6 +1378,9 @@ delprepromptfn(voidvoidfnptr_t func)
{
LinkNode ln;
+ if (!prepromptfns)
+ return;
+
for (ln = firstnode(prepromptfns); ln; ln = nextnode(ln)) {
Prepromptfn ppdat = (Prepromptfn)getdata(ln);
if (ppdat->func == func) {