Diagnose EOF on memory BIOs (or you just get mysterious errors with no error
[openssl.git] / crypto / bio / bss_mem.c
index f8c144accde22534537f985d23bc6b02d2cf20d7..c4e557822e561ade40d960232c0acc5c256521b1 100644 (file)
@@ -166,6 +166,8 @@ static int mem_read(BIO *b, char *out, int outl)
                if (b->num != 0)
                        BIO_set_retry_read(b);
                ret= b->num;
+               if(ret < 0)
+                   BIOerr(BIO_F_MEM_READ,BIO_R_EOF_ON_MEMORY_BIO);
                }
        return(ret);
        }