diff --git a/winpr/libwinpr/clipboard/synthetic.c b/winpr/libwinpr/clipboard/synthetic.c index 718d01c04..156e7389a 100644 --- a/winpr/libwinpr/clipboard/synthetic.c +++ b/winpr/libwinpr/clipboard/synthetic.c @@ -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;