[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] bbgen core dump on "empty" alternate pages



On Tue, May 30, 2006 at 12:56:21AM +0200, Kolbjørn Barmen wrote:
> 
> I just noticed something today...
> 
> A few weeks ago I set up an alternate view "TESTING:" where I can put hosts
> that are still not in production, but that might be interesting to monitor
> by the people who are setting them up. As it was I had two such hosts.
> 
> A few days ago I moved those over to PROD: which left TESTING: empty - no
> hosts. This caused bb-gen to core dump every time it tried to create the
> page for TESTING:

I also noticed this yesterday while looking at a different bug. This
patch should fix it (goes on top of todays snapshot, but will probably
apply cleanly against all of the beta/snapshots of 4.2).


Regards,
Henrik

--- bbdisplay/util.c	2006/05/03 21:12:33	1.153
+++ bbdisplay/util.c	2006/05/30 06:26:12
@@ -173,6 +173,8 @@
 static RbtIterator hostlistwalk;
 hostlist_t *hostlistBegin(void)
 {
+	if (havehosttree == 0) return NULL;
+
 	hostlistwalk = rbtBegin(hosttree);
 
 	if (hostlistwalk != rbtEnd(hosttree)) {
@@ -185,6 +187,8 @@
 
 hostlist_t *hostlistNext(void)
 {
+	if (havehosttree == 0) return NULL;
+
 	if (hostlistwalk != rbtEnd(hosttree)) hostlistwalk = rbtNext(hosttree, hostlistwalk);
 
 	if (hostlistwalk != rbtEnd(hosttree)) {