about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-08-28 08:41:51 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-08-28 08:41:51 +0000
commitc0ea4d62c81f7480192b1f61649f82d064dcb716 (patch)
tree3ff9b3deb6c3c95aa536ef59db564e73f97f4b9b /Src/Modules
parent7806ece93122c27478d74d53518c75500c3a5749 (diff)
downloadzsh-c0ea4d62c81f7480192b1f61649f82d064dcb716.tar.gz
zsh-c0ea4d62c81f7480192b1f61649f82d064dcb716.tar.xz
zsh-c0ea4d62c81f7480192b1f61649f82d064dcb716.zip
handle possible NULL pointer returned from bufferwords() (15717)
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/parameter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index fe44eafb3..23c868598 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -1105,9 +1105,9 @@ histwgetfn(Param pm)
     int i = addhistnum(curhist, -1, HIST_FOREIGN), iw;
     Histent he = gethistent(i, GETHIST_UPWARD);
 
-    ll = bufferwords(NULL, NULL, NULL);
-    for (n = firstnode(ll); n; incnode(n))
-	pushnode(l, getdata(n));
+    if ((ll = bufferwords(NULL, NULL, NULL)))
+        for (n = firstnode(ll); n; incnode(n))
+            pushnode(l, getdata(n));
 
     while (he) {
 	for (iw = he->nwords - 1; iw >= 0; iw--) {