[gnutls-devel] GnuTLS | psktool: encode username if it contains special character (!1345)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Oct 30 09:18:02 CET 2020




Sahana Prasad started a new discussion on src/psk.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1345#note_438801562

> +			fprintf(stderr, "HEX encoding error\n");
> +			ret = -1;
> +			goto out;
> +		}
> +
> +		/* prepend '#' */
> +		new_data = gnutls_realloc(_username.data, _username.size + 2);
> +		if (!new_data) {
> +			ret = -1;
> +			goto out;
> +		}
> +		memmove(_username.data + 1, _username.data, _username.size);
> +		new_data[0] = '#';
> +		new_data[_username.size] = '\0';
> +		_username.data = (void *)new_data;
> +		_username.size += 1;

@dueno maybe a +2 here as well?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1345#note_438801562
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/20201030/103a2b02/attachment-0001.html>


More information about the Gnutls-devel mailing list