File nagios-check_sip-1.3-uninitialized_problem.patch of Package monitoring-plugins-sip

Index: nagios-check_sip-1.3/check_sip
===================================================================
--- nagios-check_sip-1.3.orig/check_sip
+++ nagios-check_sip-1.3/check_sip
@@ -256,7 +256,13 @@ sub checkResponse
   my ($response, $rtime, $sp_behavior) = @_;
   my @header=split(/\r/,$response);
   my $tstring=$header[0];
+  if( !defined $tstring ) {
+    $tstring = 'Unknown error: no or invalid response from server';
+  }
   my $rcode=getResponseCode($response);  
+  if( !defined $rcode ) {
+    $rcode = 'NO RESPONSE';
+  }
   if (!$sp_behavior){
     #in this case, we want to see if the SIP-server is respoding positively to our request
     # Some SUT respond with 100 Trying - assume everything is OK if we get this
openSUSE Build Service is sponsored by