]> granicus.if.org Git - pgbadger/commitdiff
Sanity check to avoid end time before start time
authorChristophe Courtois <christophe.courtois@dalibo.com>
Thu, 9 Mar 2017 18:35:18 +0000 (19:35 +0100)
committerChristophe Courtois <christophe.courtois@dalibo.com>
Thu, 9 Mar 2017 18:35:18 +0000 (19:35 +0100)
pgbadger

index e9a937e075302443049ca44cdc3fd75e058f73f9..32bba6e7c9354d9221a71c285a8ecaebfd822a6e 100644 (file)
--- a/pgbadger
+++ b/pgbadger
@@ -915,6 +915,9 @@ if ($to) {
                 $to = "$1-$2-$3 $4:$5:$6.$7"
         }
 }
+if ($from && $to && ($from gt $to)) {
+       localdie("FATAL: begin date is after end time!\n") ;
+}
 
 # Stores the last parsed line from log file to allow incremental parsing
 my $LAST_LINE = '';