Blob Blame History Raw
From b7cca69de5f6cda32bc38504a7aa7e5bc786bbe6 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Thu, 19 Oct 2017 14:44:38 -0400
Subject: [PATCH] Ticket 48681 - Use of uninitialized value in string ne at
 /usr/bin/logconv.pl line 2565, <$LOGFH> line 4

Bug description:  The original fix for 48681 added a regression in regards to perl
                  warning everytime you ran the script.  That was due to a new hash
                  for sasl binds that was not initialized.

Fix Description:  Check is the saslbind hash "exists" before checking its value.

https://pagure.io/389-ds-base/issue/48681

Reviewed by: mreynolds (one line fix)

(cherry picked from commit e46749b77d95ad8fedf07d38890573b2862badf7)
---
 ldap/admin/src/logconv.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 4932db42e..473c71f21 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -2562,7 +2562,7 @@ sub parseLineNormal
 		if ($_ =~ /conn= *([0-9A-Z]+) +op= *([0-9\-]+)/i){
 			$conn = $1;
 			$op = $2;
-			if ($hashes->{saslconnop}->{$conn-$op} ne ""){
+			if (exists $hashes->{saslconnop}->{$conn-$op} && $hashes->{saslconnop}->{$conn-$op} ne ""){
 				# This was a SASL BIND - record the dn
 				if ($binddn ne ""){
 					if($binddn eq $rootDN){ $rootDNBindCount++; }
-- 
2.13.6