[gnutls-devel] libtasn1 | Gcc 8 warns on buffer truncation (#6)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Dec 18 09:46:39 CET 2018


You are welcome, and thanks for your efforts here.  That is a better title I'd guess.

The problem looks to be important as the code section is likely passing a longer string to snprintf than it indicates with the character count.  Adding the additional "-" guarantees that you will be one longer than expected from what I can see.

I'd think that you'd need to track current new token chars on top of current past line length chars as well as total buffer length.  This approach looks to not check return from snprintf, not ideal, and just "Adding" the "-" says using sizeof the current token, which gets bumped by one, and the length means Gcc is right to complain.

>From what I can see.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/libtasn1/issues/6#note_125734459
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/20181218/27ff9de6/attachment.html>


More information about the Gnutls-devel mailing list