[gnutls-devel] GnuTLS | Fix uninitialized warning in pkcs11.c (!906)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Feb 8 18:46:38 CET 2019


Nikos Mavrogiannopoulos started a new discussion on tests/pkcs11/pkcs11-token-raw.c:

>  		exit(1);
>  	}
>  
> +	{ /* Testing a too small buffer */
> +		char buf[1];
> +		size_t size = sizeof(buf);
> +
> +		ret = gnutls_pkcs11_token_get_info("pkcs11:",

This is a good start and it tests that a small value will return this error. It would be good to add:
 - success case; verify string is the expected
 - failure case; size is enough for string but not for null terminator

to cover the main options in the code above.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/906#note_139653012
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/20190208/9b26789f/attachment.html>


More information about the Gnutls-devel mailing list