mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
Fixed bug in DecodeAltNames() where idx wasn't advanced past the length.
This commit is contained in:
@@ -2374,6 +2374,7 @@ static void DecodeAltNames(byte* input, int sz, DecodedCert* cert)
|
|||||||
while (length > 0) {
|
while (length > 0) {
|
||||||
DNS_entry* entry;
|
DNS_entry* entry;
|
||||||
int strLen;
|
int strLen;
|
||||||
|
word lenStartIdx;
|
||||||
byte b = input[idx++];
|
byte b = input[idx++];
|
||||||
|
|
||||||
length--;
|
length--;
|
||||||
@@ -2383,10 +2384,12 @@ static void DecodeAltNames(byte* input, int sz, DecodedCert* cert)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lenStartIdx = idx;
|
||||||
if (GetLength(input, &idx, &strLen, sz) < 0) {
|
if (GetLength(input, &idx, &strLen, sz) < 0) {
|
||||||
CYASSL_MSG("\tfail: str length");
|
CYASSL_MSG("\tfail: str length");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
length -= (idx - lenStartIdx);
|
||||||
|
|
||||||
entry = (DNS_entry*)XMALLOC(sizeof(DNS_entry), cert->heap,
|
entry = (DNS_entry*)XMALLOC(sizeof(DNS_entry), cert->heap,
|
||||||
DYNAMIC_TYPE_ALTNAME);
|
DYNAMIC_TYPE_ALTNAME);
|
||||||
|
Reference in New Issue
Block a user