summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-05-17 15:20:30 +0100
committerVincent Sanders <vince@kyllikki.org>2020-05-17 15:20:30 +0100
commitaaa507b09f756cee7ca01118ee3ede3ef28ceba6 (patch)
tree00b90e53331487f0c8ac28a6315fd512c8f16f44
parent6002efff274b712c76d54ee0fba27184536cfd48 (diff)
downloadnetsurf-aaa507b09f756cee7ca01118ee3ede3ef28ceba6.tar.gz
netsurf-aaa507b09f756cee7ca01118ee3ede3ef28ceba6.tar.bz2
use entity for colon in certificate hex values to allow netsurf to break properly
-rw-r--r--content/fetchers/about.c12
1 files 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&#58;YY&#58; */
+ 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++;