From aaa507b09f756cee7ca01118ee3ede3ef28ceba6 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 17 May 2020 15:20:30 +0100 Subject: use entity for colon in certificate hex values to allow netsurf to break properly --- content/fetchers/about.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/content/fetchers/about.c b/content/fetchers/about.c index 5d1208dc5..1fbca6155 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -669,6 +669,9 @@ xname_to_info(X509_NAME *xname, struct ns_cert_name *iname) /** * duplicate a hex formatted string inserting the colons + * + * \todo only uses html entity as separator because netsurfs line breaking + * fails otherwise. */ static char *hexdup(const char *hex) { @@ -678,13 +681,18 @@ static char *hexdup(const char *hex) int cn = 0; hexlen = strlen(hex); - dst = malloc(((hexlen * 3) + 1) / 2); + /* allow space fox XXYY to XX:YY: */ + dst = malloc(((hexlen * 7) + 6) / 2); if (dst != NULL) { for (out = dst; *hex != 0; hex++) { if (cn == 2) { cn = 0; - *out++ = ':'; + *out++ = '&'; + *out++ = '#'; + *out++ = '5'; + *out++ = '8'; + *out++ = ';'; } *out++ = *hex; cn++; -- cgit v1.2.3