Check for NULL before dereferencing a pointer

l is part of the exit condition of the while loop. If we exit the loop
because l is NULL, we cannot dereference it.
This commit is contained in:
Rene Kita
2021-12-28 16:22:51 +01:00
parent 6432709b80
commit 1365cc1ecc
+2 -1
View File
@@ -8139,7 +8139,8 @@ getNextPage(Buffer *buf, int plen)
l = l->next;
} while (l && l->bpos);
buf->firstLine = l;
buf->firstLine->prev = NULL;
if (l)
buf->firstLine->prev = NULL;
}
}
pager_end: