In the right circumstances, DropOldData() will
dereference a null pointer. The attached patch file
corrects this problem (tested with version 1.1.4 and
Details: If no traffic for a particular IP address is
seen for a long time, all of its traffic data will
eventually be culled by DropOldData(). If the IP
address happens to be the first one in the IPDataStore
list, then the result is that IPDataStore->FirstBlock
becomes a null pointer. This causes a segfault on line
304 of bandwidthd.c.
The simple fix implemented here is to check if
DataStore->FirstBlock is non-null before dereferencing
it. A nicer solution would be to properly remove the
first IPDataStore entry from the list just like any
other, but I'll leave that as an exercise...
Incidentally, the "make count data persistent across
restarts" patch was useful in reproducing and debugging
this crash, as I was able to use the CDF file generated
when the crash occurred, and "replay" the sequence of
events that caused it.