From 0e0cb92067894b44c4616c0ca3622a555adf404c Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 2 Mar 2024 11:35:09 +0000 Subject: Fix CRYPTO_malloc/free signatures Importantly, the size in malloc is now a size_t instead of an int. The API now also takes a file and line to match upstream's signature. ok jsing --- src/lib/libcrypto/malloc-wrapper.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib/libcrypto/malloc-wrapper.c') diff --git a/src/lib/libcrypto/malloc-wrapper.c b/src/lib/libcrypto/malloc-wrapper.c index e13cc23373..fb42169b2f 100644 --- a/src/lib/libcrypto/malloc-wrapper.c +++ b/src/lib/libcrypto/malloc-wrapper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc-wrapper.c,v 1.9 2024/03/02 11:28:46 tb Exp $ */ +/* $OpenBSD: malloc-wrapper.c,v 1.10 2024/03/02 11:35:09 tb Exp $ */ /* * Copyright (c) 2014 Bob Beck * @@ -37,10 +37,8 @@ CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), LCRYPTO_ALIAS(CRYPTO_set_mem_ex_functions); void * -CRYPTO_malloc(int num, const char *file, int line) +CRYPTO_malloc(size_t num, const char *file, int line) { - if (num <= 0) - return NULL; return malloc(num); } @@ -51,7 +49,7 @@ CRYPTO_strdup(const char *str, const char *file, int line) } void -CRYPTO_free(void *ptr) +CRYPTO_free(void *ptr, const char *file, int line) { free(ptr); } -- cgit v1.2.3-55-g6feb