ENGINE_load_[private|public]_key had error handling that could return
[openssl.git] / ssl / s2_lib.c
index a89958607cfd2800e03f5d0e90535891fa0ac704..09fde61b5b97f0940cb8001ff516cbba2387775d 100644 (file)
@@ -57,7 +57,7 @@
  */
 
 #include "ssl_locl.h"
-#ifndef NO_SSL2
+#ifndef OPENSSL_NO_SSL2
 #include <stdio.h>
 #include <openssl/rsa.h>
 #include <openssl/objects.h>
@@ -260,7 +260,7 @@ SSL_CIPHER *ssl2_get_cipher(unsigned int u)
 
 int ssl2_pending(SSL *s)
        {
-       return(s->s2->ract_data_length);
+       return SSL_in_init(s) ? 0 : s->s2->ract_data_length;
        }
 
 int ssl2_new(SSL *s)
@@ -479,7 +479,7 @@ int ssl2_shutdown(SSL *s)
        s->shutdown=(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
        return(1);
        }
-#else /* !NO_SSL2 */
+#else /* !OPENSSL_NO_SSL2 */
 
 # if PEDANTIC
 static void *dummy=&dummy;