$OpenBSD: patch-bin_mrtg,v 1.3 2010/05/18 08:31:43 sthen Exp $
--- bin/mrtg.orig	Wed Jan 20 10:56:29 2010
+++ bin/mrtg	Tue Mar 16 15:26:34 2010
@@ -615,6 +615,9 @@ sub getcurrent {
 		$uptime = $target->[ $u ]{ _UPTIME_ };
 		$name = $target->[ $u ]{ _NAME_ };
 		$time = $target->[ $u ]{ _TIME_ };
+		if ($time =~ /^([-0-9.]+)$/) {
+			$time = $1;
+		}
 	}
 
 	# Set the time to the current time if it was not set above
@@ -950,6 +953,14 @@ sub writegraphics {
     # set values to -1 to tell rateup about unknown values
     $inlast = -1 unless defined $inlast;
     $outlast = -1 unless defined $outlast;
+
+    # untaint
+    if ($inlast =~ /^([-0-9.]+)$/) {
+        $inlast = $1;
+    }
+    if ($outlast =~ /^([-0-9.]+)$/) {
+        $outlast = $1;
+    }
     
     if ($$rcfg{'options'}{'dorelpercent'}{$router}) {
         @exec = ("${FindBin::Bin}${MRTG_lib::SL}rateup", 
