From 9f26ac3b2e739359268e4e255f97592ccafe1f89 Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 15 Aug 2022 10:48:45 +0000 Subject: Initialize readbytes in BIO_gets() If the bgets() callback returns <= 0, we currently rely on the user provided callback to set readbytes, which isn't ideal. This also matches what's done in BIO_read() and BIO_write(). ok jsing --- src/lib/libcrypto/bio/bio_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 0b6c9ecac0..2ac0abd82e 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_lib.c,v 1.35 2022/01/14 08:40:57 tb Exp $ */ +/* $OpenBSD: bio_lib.c,v 1.36 2022/08/15 10:48:45 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -464,7 +464,7 @@ BIO_puts(BIO *b, const char *in) int BIO_gets(BIO *b, char *in, int inl) { - size_t readbytes; + size_t readbytes = 0; int ret; if (b == NULL || b->method == NULL || b->method->bgets == NULL) { -- cgit v1.2.3-55-g6feb