From abaef2e869fefcb0fac237bdf1b96c16ce8e290b Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Tue, 26 Jul 2016 11:57:24 -0400 Subject: Fix omitted selector handling. The selector field could be omitted because it has a DEFAULT value. In this case *sfld == NULL (sfld can never be NULL). This was not noticed because this was never used in existing ASN.1 modules. (Imported from upstream's c4210673313482edacede58d92e92c213d7a181a.) svaldez and I stared at this for a while and we believe this change is correct. It's also irrelevant because our only remaining ADB (ANY DEFINED BY) table is POLICYQUALINFO which does not allow its selector to be omitted. Also, if it did, it would be a slight change in behavior. We'd switch from using POLICYQUALINFO's default_tt (filling in an ASN1_ANY) to its null_tt (which doesn't exist, so error). Change-Id: If6a929e3dafca18431775b01958d0dae1c09f3b4 Reviewed-on: https://boringssl-review.googlesource.com/8943 Reviewed-by: Adam Langley Commit-Queue: Adam Langley CQ-Verified: CQ bot account: commit-bot@chromium.org --- crypto/asn1/tasn_utl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto') diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c index 960cdbb7..55037a18 100644 --- a/crypto/asn1/tasn_utl.c +++ b/crypto/asn1/tasn_utl.c @@ -222,7 +222,7 @@ const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, sfld = offset2ptr(*pval, adb->offset); /* Check if NULL */ - if (!sfld) { + if (*sfld == NULL) { if (!adb->null_tt) { goto err; } -- cgit v1.2.3