$OpenBSD: patch-lib_OpenSSL_pm,v 1.1 2005/05/25 06:09:11 msf Exp $
--- lib/OpenSSL.pm.orig	Tue May 24 15:30:54 2005
+++ lib/OpenSSL.pm	Tue May 24 15:41:58 2005
@@ -479,7 +479,11 @@ sub parsecrl {
    }
 
    # get "normal infos"
-   @lines = split(/\n/, $tmp->{'TXT'});
+   if ($tmp->{'TXT'}) {
+      @lines = split(/\n/, $tmp->{'TXT'});
+   } else {
+      @lines = ();
+   }
    foreach(@lines) {
       if ($_ =~ /Signature Algorithm.*: (\w+)/i) {
          $tmp->{'SIG_ALGORITHM'} = $1;
@@ -497,7 +501,10 @@ sub parsecrl {
 
    # get revoked certs
    $tmp->{'LIST'} = [];
-   for($i = 0; $lines[$i] !~ /^[\s\t]*Revoked Certificates:$/i; $i++) {
+   for($i = 0; 
+       ($i < scalar(@lines)) && 
+       ($lines[$i] !~ /^[\s\t]*Revoked Certificates:$/i); 
+      $i++) {
       $self->{'CACHE'}->{$file} = $tmp;
       return($tmp) if ($lines[$i] =~ /No Revoked Certificates/i);
    }
