Skip to content

Commit

Permalink
CRYPTO_mem_debug_push() and CRYPTO_mem_debug_pop() should return 0
Browse files Browse the repository at this point in the history
Those 2 functions historically only ever returned 0 or 1. In OpenSSL 3.0
they were made no-ops and the documentation says they always return 0. In
fact they were returning -1. If any application was actually using these
functions then it may appear that they were actually successful (e.g. -1
could be interpreted as "true").

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #18967)

(cherry picked from commit f868454)
  • Loading branch information
mattcaswell authored and t8m committed Aug 17, 2022
1 parent 5a07d91 commit b89f113
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/mem.c
Expand Up @@ -285,12 +285,12 @@ int CRYPTO_set_mem_debug(int flag)
int CRYPTO_mem_debug_push(const char *info, const char *file, int line)
{
(void)info; (void)file; (void)line;
return -1;
return 0;
}

int CRYPTO_mem_debug_pop(void)
{
return -1;
return 0;
}

void CRYPTO_mem_debug_malloc(void *addr, size_t num, int flag,
Expand Down

0 comments on commit b89f113

Please sign in to comment.