From ac910fc8efbc518a705326409d1b3ab0036d46af Mon Sep 17 00:00:00 2001 From: schwarze <> Date: Tue, 20 Aug 2019 10:59:09 +0000 Subject: make BN_CTX_end(NULL) a NOOP for compatibility with documented behaviour in OpenSSL 1.1.1 even though in general, letting random functions accept NULL is not advisable because it can hide programming errors; "yes please" tb@ "unfortunately I suspect you're right" jsing@ "oh well" deraadt@ --- src/lib/libcrypto/bn/bn_ctx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/bn') diff --git a/src/lib/libcrypto/bn/bn_ctx.c b/src/lib/libcrypto/bn/bn_ctx.c index 1237ac1365..0d64ccab93 100644 --- a/src/lib/libcrypto/bn/bn_ctx.c +++ b/src/lib/libcrypto/bn/bn_ctx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_ctx.c,v 1.15 2017/01/29 17:49:22 beck Exp $ */ +/* $OpenBSD: bn_ctx.c,v 1.16 2019/08/20 10:59:09 schwarze Exp $ */ /* Written by Ulf Moeller for the OpenSSL project. */ /* ==================================================================== * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. @@ -283,6 +283,9 @@ BN_CTX_start(BN_CTX *ctx) void BN_CTX_end(BN_CTX *ctx) { + if (ctx == NULL) + return; + CTXDBG_ENTRY("BN_CTX_end", ctx); if (ctx->err_stack) -- cgit v1.2.3-55-g6feb