Skip to content

Commit 54370cc

Browse files
authored
Merge pull request #7829 from douzzer/20240804-SetDNSEntry-double-free
20240804-SetDNSEntry-double-free
2 parents 9aa0742 + d65be7a commit 54370cc

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9177,7 +9177,7 @@ int EncryptContent(byte* input, word32 inputSz, byte* out, word32* outSz,
91779177
word32 seqSz;
91789178
word32 innerSz;
91799179
int ret;
9180-
int version, id, blockSz = 0;
9180+
int version, id = PBE_NONE, blockSz = 0;
91819181
#ifdef WOLFSSL_SMALL_STACK
91829182
byte* saltTmp = NULL;
91839183
byte* cbcIv = NULL;
@@ -13550,7 +13550,6 @@ static int SetDNSEntry(DecodedCert* cert, const char* str, int strLen,
1355013550
dnsEntry->name = (char*)XMALLOC((size_t)strLen + 1, cert->heap,
1355113551
DYNAMIC_TYPE_ALTNAME);
1355213552
if (dnsEntry->name == NULL) {
13553-
XFREE(dnsEntry, cert->heap, DYNAMIC_TYPE_ALTNAME);
1355413553
ret = MEMORY_E;
1355513554
}
1355613555
}

wolfssl/wolfcrypt/asn.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2760,7 +2760,9 @@ enum PBESTypes {
27602760

27612761
PBES2 = 13, /* algo ID */
27622762
PBES1_MD5_DES = 3,
2763-
PBES1_SHA1_DES = 10
2763+
PBES1_SHA1_DES = 10,
2764+
2765+
PBE_NONE = 999
27642766
};
27652767

27662768
enum PKCSTypes {

0 commit comments

Comments
 (0)