[gnutls-devel] GnuTLS | Refactor `_gnutls_buffer_pop_prefix*` (!2121)

(Deprecated) Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Aug 3 13:32:51 CEST 2026




Daiki Ueno commented on a discussion on lib/str.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/2121#note_3636348416

 >  	return _gnutls_buffer_append_data(buf, ss, pfx_size);
 >  }
 >  
 > -int _gnutls_buffer_pop_prefix8(gnutls_buffer_st *buf, uint8_t *data, int check)
 > +int _gnutls_buffer_pop_prefix8(gnutls_buffer_st *buf, uint8_t *data)
 >  {
 > -	if (buf->length < 1) {
 > -		gnutls_assert();
 > +	if (_gnutls_buffer_pop_uint8(buf, data)) {
 >  		return GNUTLS_E_PARSING_ERROR;
 >  	}
 >  
 > -	*data = buf->data[0];
 > -
 > -	if (check && *data > buf->length - 1) {
 > +	if (buf->length < 1 || *data > buf->length - 1) {

That's a very good point (and AI didn't notice that). Thanks :-)

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/2121#note_3636348416
You're receiving this email because of your account on gitlab.com. Unsubscribe from this thread: https://gitlab.com/-/namespace/17175643/sent_notifications/6-bpff8r5iiv0k3uwi6lp25c02q-a84t7/unsubscribe | Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help


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


More information about the Gnutls-devel mailing list