* fhandler_clipboard.cc (fhandler_dev_clipboard::read): Fix buffer

read access overrun when pos > 0.
This commit is contained in:
Corinna Vinschen
2013-06-17 10:11:54 +00:00
parent f4ddbb8ebf
commit 42c8e85109
3 changed files with 10 additions and 1 deletions

View File

@ -295,7 +295,8 @@ fhandler_dev_clipboard::read (void *ptr, size_t& len)
!= (size_t) -1
&& (ret > conv_len
/* Skip separated high surrogate: */
|| ((buf [pos + glen - 1] & 0xFC00) == 0xD800 && glen - pos > 1)))
|| ((buf [glen - 1] & 0xFC00) == 0xD800
&& glen - pos > 1)))
--glen;
if (ret == (size_t) -1)
ret = 0;