[gnutls-devel] GnuTLS | trust: make filesystem path construction flexible (!1493)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Sat Dec 24 14:29:51 CET 2022




Tim Rühsen started a new discussion on lib/pathbuf.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1493#note_1220510637

> +
> +	/* path separator */
> +	if (!INT_ADD_OK(len, 1, &len)) {
> +		return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
> +	}
> +
> +	ret = pathbuf_reserve(buffer, len);
> +	if (ret < 0) {
> +		return ret;
> +	}
> +
> +	p = stpcpy(&buffer->ptr[buffer->len], "/");
> +	p = stpcpy(p, component);
> +	*p = '\0';
> +
> +	buffer->len += len;

Why not using INT_ADD_OK here (maybe do this into a tmp variable further up to bail out early) ?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1493#note_1220510637
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/20221224/e8272b57/attachment.html>


More information about the Gnutls-devel mailing list