Correct error in processing of second component
Root nodes 0 and 1 may have up to 40 children (0 - 39), not 39 children (0 - 38) as previously thought. Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
18ec9d7da1
commit
03329970de
1 changed files with 2 additions and 2 deletions
|
@ -974,8 +974,8 @@ int mbedtls_oid_from_numeric_string(mbedtls_asn1_buf *oid,
|
||||||
if (component2 < 0) {
|
if (component2 < 0) {
|
||||||
return component2;
|
return component2;
|
||||||
}
|
}
|
||||||
if ((component1 < 2) && (component2 > 38)) {
|
if ((component1 < 2) && (component2 > 39)) {
|
||||||
/* Root nodes 0 and 1 may have up to 39 children */
|
/* Root nodes 0 and 1 may have up to 40 children, numbered 0-39 */
|
||||||
return MBEDTLS_ERR_ASN1_INVALID_DATA;
|
return MBEDTLS_ERR_ASN1_INVALID_DATA;
|
||||||
}
|
}
|
||||||
if (str_ptr < str_bound && *str_ptr != '\0') {
|
if (str_ptr < str_bound && *str_ptr != '\0') {
|
||||||
|
|
Loading…
Reference in a new issue