Commit b76560f4 authored by Georgi Chorbadzhiyski's avatar Georgi Chorbadzhiyski

Do not initialize mrtg functionality if mrtg file is not set.

mrtgInit() is not checking if filename parameter is NULL so
when dvblast is run without -Z option that sets mrtg file
the following error is seen in valgrind:

 Syscall param open(filename) points to unaddressable byte(s)
    at 0x412798E: __open_nocancel (in /lib/libc-2.13.so)
    by 0x40BCA33: __fopen_internal (in /lib/libc-2.13.so)
    by 0x40BCA9B: fopen@@GLIBC_2.1 (in /lib/libc-2.13.so)
    by 0x8062841: mrtgInit (mrtg-cnt.c:167)
    by 0x4073DB5: (below main) (in /lib/libc-2.13.so)
parent 45f333fa
......@@ -161,6 +161,8 @@ int mrtgAnalyse(block_t * p_ts)
int mrtgInit(char *mrtg_file)
{
if ( !mrtg_file )
return -1;
/* Open MRTG file */
msg_Dbg(NULL, "Opening mrtg file %s.\n", mrtg_file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment