1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 16:50:58 +01:00

handle possible NULL pointer returned from bufferwords() (15717)

This commit is contained in:
Sven Wischnowsky 2001-08-28 08:41:51 +00:00
parent 7806ece931
commit c0ea4d62c8
4 changed files with 16 additions and 10 deletions

View file

@ -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--) {