Hi,

I am afraid that version 1.14-22 does not completely solve the issue,
I see the following error while it is parsing lines starting with "Aug 20 
18:36:06..."

# /usr/sbin/mailgraph
Use of uninitialized value $montxt in hash element at /usr/sbin/mailgraph line 
243.
Use of uninitialized value $montxt in concatenation (.) or string at 
/usr/sbin/mailgraph line 244.
unknown month 
 at /usr/sbin/mailgraph line 244.
        Parse::Syslog::_next_syslog(Parse::Syslog=HASH(0x5558ca313bd0)) called 
at /usr/sbin/mailgraph line 370
        Parse::Syslog::next(Parse::Syslog=HASH(0x5558ca313bd0)) called at 
/usr/sbin/mailgraph line 503
        Parse::Syslog::main() called at /usr/sbin/mailgraph line 967


When we look at the source code, we see that...

   226          else {
   227              my($montxt);
   228              ($mon, $day, $hour, $min, $sec, $host, $text) = $str =~ /^
   229                  (\S{3})\s+(\d+)      # date
   230                  \s
   231                  (\d+):(\d+):(\d+)    # time
   232                  (?:\s<\w+\.\w+>)?    # FreeBSD's verbose-mode
   233                  \s
   234                  ([-\w\.\@:]+)        # host
   235                  \s+
   236                  (?:\[LOG_[A-Z]+\]\s+)?  # FreeBSD
   237                  (.*)                 # text
   238                  $/x or do
   239              {
   240                  warn "WARNING: line not in syslog format: $str";
   241                  next line;
   242              };
   243              $mon = $months_map{$montxt};
   244              defined $mon or croak "unknown month $montxt\n";
   245              $self->_year_increment($mon);
   246          }

...in line 243 the variable $montxt is read, and that earlier, in line
227, it is declared, but it is never initialised in between. Therefore, in
line 243 it is still undefined, leading to the error mentioned earlier.
Perhaps the "$mon" in line 228 should be "$montxt"?

kind regards,
Andreas

Reply via email to