Fix typo in i2d_ASN1_ENUMERATED
[openssl.git] / crypto / bio / bss_mem.c
index c4e5578..4fa2cf1 100644 (file)
@@ -214,6 +214,7 @@ static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
                        /* For read only case reset to the start again */
                        if(b->flags & BIO_FLAGS_MEM_RDONLY) 
                                        bm->data -= bm->max - bm->length;
+                                       bm->length = bm->max;
                        else {
                                memset(bm->data,0,bm->max);
                                bm->length=0;