From 4524c90576bcff57b4fd56444b7d73d735555310 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Sat, 28 Mar 2009 06:40:48 +0000 Subject: [PATCH] Avoid NULL deference which causes DEBUG1 to crash, not to print useful information. Obtained from: OpenBSD --- lib/libc/db/hash/hash_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c index 6d26b167055b..4445fc52b043 100644 --- a/lib/libc/db/hash/hash_buf.c +++ b/lib/libc/db/hash/hash_buf.c @@ -282,7 +282,7 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp) */ #ifdef DEBUG1 (void)fprintf(stderr, "NEWBUF2: %d->ovfl was %d is now %d\n", - prev_bp->addr, (prev_bp->ovfl ? bp->ovfl->addr : 0), + prev_bp->addr, (prev_bp->ovfl ? prev_bp->ovfl->addr : 0), (bp ? bp->addr : 0)); #endif prev_bp->ovfl = bp;