[gnutls-devel] GnuTLS | Fix coverity in lib/ (!1092)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Sat Oct 12 19:12:06 CEST 2019




Tim Rühsen commented on a discussion on lib/str.c: https://gitlab.com/gnutls/gnutls/merge_requests/1092#note_229648567

>  
>  	while (pos < dest->length) {
>  		if (dest->data[pos] == '%') {
> -			char b[3];
> -			unsigned int u;
>  			unsigned char x;
>  
> -			b[0] = dest->data[pos + 1];
> -			b[1] = dest->data[pos + 2];
> -			b[2] = 0;
> -
> -			sscanf(b, "%02x", &u);
> -
> -			x = u;
> +			hex_decode((char *) dest->data + pos + 1, 2, &x, 1);

Pushed a unit test for _gnutls_buffer_unescape() which of course fails until we agree on writing `_gnutls_buffer_append_unescape()`. If we don't agree, i have to fix `_gnutls_buffer_unescape()` by other means.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1092#note_229648567
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/20191012/07a097b1/attachment.html>


More information about the Gnutls-devel mailing list