The pointer to the buffer tree node is dereferenced unconditionally
in btr_get_node_start(). This patch makes sure we never pass a NULL
pointer to this function.
FOR_EACH_SLOT(i) {
struct slot_info *s = &slot[i];
struct timeval wstime;
FOR_EACH_SLOT(i) {
struct slot_info *s = &slot[i];
struct timeval wstime;
+ if (!s->wns || !s->wns[0].btrn)
continue;
btr_get_node_start(s->wns[0].btrn, &wstime);
if (oldest_slot >= 0 && tv_diff(&wstime, &oldest_wstime, NULL) > 0)
continue;
btr_get_node_start(s->wns[0].btrn, &wstime);
if (oldest_slot >= 0 && tv_diff(&wstime, &oldest_wstime, NULL) > 0)