clipboard: fix possible invalid memory access

Fix an possible issue found by Sébastien Duquette.
This commit is contained in:
Bernhard Miklautz 2017-07-17 15:21:58 +02:00 committed by Armin Novak
parent 0dc45c733e
commit f23e10f64b
1 changed files with 1 additions and 1 deletions

View File

@ -445,7 +445,7 @@ static void* clipboard_synthesize_text_html(wClipboard* clipboard, UINT32 format
beg = atoi(&begStr[10]);
end = atoi(&endStr[8]);
if ((beg > SrcSize) || (end > SrcSize) || (beg >= end))
if (beg < 0 || end < 0 || (beg > SrcSize) || (end > SrcSize) || (beg >= end))
return NULL;
DstSize = end - beg;