From 7342d3896446deaf89ab5582da81457571e48fe6 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Sat, 20 Jun 2009 23:22:41 +0200 Subject: Handle logs with NUL chars better It is not too rare that '\0' chars appear in /var/log/messages. I saw a real-life case where kerneloops would show a popup with the same old oops after every login. It turned out that there were NUL chars in the log which prevented kerneloops from seeing its marker, so it always treated the old oops in the log as new. This patch fixes it by always going through the whole known length of the buffer (not stopping on NUL chars) and using less string-oriented functions in fill_lineinfo(). --- lib/Plugins/KerneloopsSysLog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Plugins/KerneloopsSysLog.h') diff --git a/lib/Plugins/KerneloopsSysLog.h b/lib/Plugins/KerneloopsSysLog.h index c233d993..ff4c8ba2 100644 --- a/lib/Plugins/KerneloopsSysLog.h +++ b/lib/Plugins/KerneloopsSysLog.h @@ -42,7 +42,7 @@ class CSysLog private: void QueueOops(char *data, char *version); int ExtractVersion(char *linepointer, char *version); - int FillLinePointers(char *buffer, int remove_syslog); + int FillLinePointers(char *buffer, size_t buflen, int remove_syslog); std::list m_OopsQueue; int m_nFoundOopses; -- cgit