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

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


  Branch: refs/heads/openssl-3.2
  Home:   https://github.com/openssl/openssl
  Commit: 1d79a13c8003d78c182524918620b60d06519dbc
      https://github.com/openssl/openssl/commit/1d79a13c8003d78c182524918620b60d06519dbc
  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)

(cherry picked from commit e7d34d7ae32f16abbd79a49072cff580bee32269)




More information about the openssl-commits mailing list