From ed2e4e576d40f68736f5ff828b3b0fef083b2a67 Mon Sep 17 00:00:00 2001 From: Anton Afanasyev Date: Sat, 6 Jan 2018 18:45:22 -0800 Subject: [PATCH] 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 --- winpr/libwinpr/clipboard/synthetic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winpr/libwinpr/clipboard/synthetic.c b/winpr/libwinpr/clipboard/synthetic.c index 55767f08a..a5d3c60fa 100644 --- a/winpr/libwinpr/clipboard/synthetic.c +++ b/winpr/libwinpr/clipboard/synthetic.c @@ -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;