[gnutls-devel] GnuTLS | Datum.c cleanup (!1002)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Mon May 20 22:14:11 CEST 2019




Nikos Mavrogiannopoulos commented on a discussion on lib/datum.c: https://gitlab.com/gnutls/gnutls/merge_requests/1002#note_172463387

>  		return 0;
>  	}
>  
> -	dat->data = gnutls_malloc(data_size);

It may be in general but in this particular case it looks like a safety feature. Both of these functions are initialization functions, and for code like:
```
_gnutls_set_datum(x, "y", 1);
printf("%s", x.data);
```
when allocation fails, they will prevent an uninitialized x.data to be passed to printf().

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1002#note_172463387
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/20190520/7c62175a/attachment-0001.html>


More information about the Gnutls-devel mailing list