Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions wolfcrypt/src/asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -41543,11 +41543,11 @@ static void PrintObjectIdText(Asn1* asn1, Asn1PrintOptions* opts)
int nid;
#endif
const char* ln = NULL;
word32 i = 0;
word32 idx = 0;
int known = 1;

/* Get the OID value for the OBJECT_ID. */
if (GetObjectId(asn1->data + asn1->offset, &i, &oid, oidIgnoreType,
if (GetObjectId(asn1->data + asn1->offset, &idx, &oid, oidIgnoreType,
asn1->item.len + 2) == WC_NO_ERR_TRACE(ASN_PARSE_E)) {
known = 0;
}
Expand All @@ -41563,9 +41563,9 @@ static void PrintObjectIdText(Asn1* asn1, Asn1PrintOptions* opts)
/* Lookup long name for extra known OID values. */
if (Oid2LongName(oid, &ln) != 0) {
}
else if ((asn1->nameCb != NULL) &&
else if ((asn1->nameCb != NULL) && (idx >= 2) &&
((ln = asn1->nameCb(asn1->data + asn1->offset + 2,
i - 2))) != NULL) {
idx - 2))) != NULL) {
}
else {
/* Unknown OID value. */
Expand Down