From: Viktor Dukhovni Date: Sat, 21 Nov 2015 05:59:07 +0000 (-0500) Subject: Good hygiene with size_t output argument. X-Git-Tag: OpenSSL_1_1_0-pre1~205 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=5c649375dd756dcd0b0c81a14a04cd8e87f198c1 Good hygiene with size_t output argument. Though the callers check the function return value and ignore the size_t output argument on failure, it is still often not ideal to store (-1) in size_t on error. That might signal an unduly large buffer. Instead set the size_t to 0, to indicate no space. Reviewed-by: Richard Levitte --- diff --git a/ssl/s3_cbc.c b/ssl/s3_cbc.c index 5225222913..177f6d736f 100644 --- a/ssl/s3_cbc.c +++ b/ssl/s3_cbc.c @@ -278,7 +278,7 @@ int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, */ OPENSSL_assert(0); if (md_out_size) - *md_out_size = -1; + *md_out_size = 0; return 0; }