mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-02 01:04:33 +03:00
use entity for colon in certificate hex values to allow netsurf to break properly
This commit is contained in:
parent
6002efff27
commit
aaa507b09f
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user