]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-cvsserver.perl
git-cvsserver: protect against NULL in crypt(3)
[thirdparty/git.git] / git-cvsserver.perl
index 4c93b5d099178adfb9f583e4a9cd544096dc1aee..64319bed43f2b4916910480223f1089ce90990ef 100755 (executable)
@@ -222,10 +222,11 @@ if ($state->{method} eq 'pserver') {
         open my $passwd, "<", $authdb or die $!;
         while (<$passwd>) {
             if (m{^\Q$user\E:(.*)}) {
-                if (crypt(descramble($password), $1) eq $1) {
+                my $hash = crypt(descramble($password), $1);
+                if (defined $hash and $hash eq $1) {
                     $auth_ok = 1;
                 }
-            };
+            }
         }
         close $passwd;