From 16148961562d760ce94f50c41ed466c337850317 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 6 Jan 2014 16:26:50 -0800 Subject: [PATCH] fix warning about use of regexp on undef string --- useradmin/md5-lib.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/useradmin/md5-lib.pl b/useradmin/md5-lib.pl index c8250114e..4c6069ace 100755 --- a/useradmin/md5-lib.pl +++ b/useradmin/md5-lib.pl @@ -29,11 +29,11 @@ sub encrypt_md5 { my ($passwd, $salt) = @_; my $magic = '$1$'; -if ($salt =~ /^\$1\$([^\$]+)/) { +if ($salt && $salt =~ /^\$1\$([^\$]+)/) { # Extract actual salt from already encrypted password $salt = $1; } -if ($salt !~ /^[a-z0-9\/\.]{8}$/i) { +if ($salt && $salt !~ /^[a-z0-9\/\.]{8}$/i) { # Non-MD5 salt $salt = undef; }