StartHTML and EndHTML values can be left-padded with 0 characters. strtol and friends treat this as base-8 if base is specified as 0.

Because these values are always sent in base-10, fix is to always use base-10
This commit is contained in:
Anton Afanasyev
2018-01-06 18:45:22 -08:00
parent db5628f6ff
commit ed2e4e576d

View File

@@ -439,12 +439,12 @@ static void* clipboard_synthesize_text_html(wClipboard* clipboard, UINT32 format
return NULL;
errno = 0;
beg = strtol(&begStr[10], NULL, 0);
beg = strtol(&begStr[10], NULL, 10);
if (errno != 0)
return NULL;
end = strtol(&endStr[8], NULL, 0);
end = strtol(&endStr[8], NULL, 10);
if (beg < 0 || end < 0 || (beg > SrcSize) || (end > SrcSize) || (beg >= end) || (errno != 0))
return NULL;