From f23e10f64b72ad74c3de06343813414bc072f714 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Mon, 17 Jul 2017 15:21:58 +0200 Subject: [PATCH] clipboard: fix possible invalid memory access MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix an possible issue found by Sébastien Duquette. --- winpr/libwinpr/clipboard/synthetic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winpr/libwinpr/clipboard/synthetic.c b/winpr/libwinpr/clipboard/synthetic.c index 718d01c..156e738 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; -- 2.7.4