[openssl/openssl] e7d34d: Fix a possible memory leak in SM2 provider

AmosX noreply at github.com
Thu Nov 23 15:11:09 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: e7d34d7ae32f16abbd79a49072cff580bee32269
      https://github.com/openssl/openssl/commit/e7d34d7ae32f16abbd79a49072cff580bee32269
  Author: Huiyue Xu <xuhuiyue at huawei.com>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M providers/implementations/signature/sm2_sig.c

  Log Message:
  -----------
  Fix a possible memory leak in SM2 provider

ctx->propq that strdup from input parameter propq in sm2sig_newctx,
is not released. It should be released in sm2sig_freectx and copied
to dstctx in sm2sig_dupctx. And dstctx->id and dstctx->propq should
be set NULL to avoid releasing id/propq of srcctx when err occurs.

Signed-off-by: Huiyue Xu <xuhuiyue at huawei.com>

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Paul Yang <kaishen.yy at antfin.com>
Reviewed-by: Hugo Landau <hlandau at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22796)




More information about the openssl-commits mailing list