Monday, July 18, 2005

A small C bug...

C is know to "bite". Today, it bit me ;) rsyslog, as I thought initially, did duplicate the TIMESTAMP and the fields after it when relaying data. Looking closer, I found that actually the timestamp was not correctly parsed. As such, all fields were invalid, not only when forwarding but also when storing data. What a shame... The cause, however, is even somewhat more shamefull - should I really tell? ;) Of course I do. One of my beloved ultry-optimal parsers had a small bug. I incremented a character pointer at the wrong place, makeing it point to the wrong location. It did not cause a buffer overflow or something like that, but it resulted in each message to be treated like one without a proper TIMESTAMP - leading to all the mess. Obviously, this is something that needs to be fixed and I already did this. I just need to package everything, so hopefully tomorrow we will see a new release. Oh, btw, did you wonder why I didn't catch this bug earlier? Well, it appeared the first time in July... If you wonder why, you need to look at the code. I won't tell all dirty little secrets here (but it's well-documented in syslogd.c).

No comments: