As far as I can tell this should never happen.
---
lib/coding.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/coding.c b/lib/coding.c
index 7f9173c..9598067 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -865,6 +865,8 @@ _asn1_ordering_set_of (unsigned char *der, int der_len,
asn1_node node)
while (p && ((type_field (p->type) == ASN1_ETYPE_TAG) ||
(type_field (p->type) == ASN1_ETYPE_SIZE)))
p = p->right;
+ if (p == NULL)
+ return ASN1_VALUE_NOT_VALID;
p = p->right;
if ((p == NULL) || (p->right == NULL))
--
1.9.2