[gnutls-devel] libtasn1 | Fix handling of code which uses NULL pointers + offset (fixes issue #30) (!71)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Wed Feb 3 15:34:34 CET 2021



Merge request https://gitlab.com/gnutls/libtasn1/-/merge_requests/71 was reviewed by Roman Bolshakov

--
  
Roman Bolshakov started a new discussion on lib/coding.c: https://gitlab.com/gnutls/libtasn1/-/merge_requests/71#note_500586351

>    int err;
>    unsigned char *der = ider;
> +  unsigned char dummy;

I don't think if we should play with compliant optimizer. Arithmetic on null pointers is UB.

--
  
Roman Bolshakov started a new discussion on lib/coding.c: https://gitlab.com/gnutls/libtasn1/-/merge_requests/71#note_500586360

>  	      len2 = max_len;
> -	      err = _asn1_object_id_der ((char*)p->value, der + counter, &len2);
> +	      err = _asn1_object_id_der ((char*)p->value, der ? der + counter : &dummy, &len2);

Instead we should add `counter` as a separate parameter to `_asn1_object_id_der()` and similar functions below right after `der`.


-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/libtasn1/-/merge_requests/71
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20210203/96f52f17/attachment-0001.html>


More information about the Gnutls-devel mailing list