* 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

@ -1,3 +1,8 @@
2013-06-17 Corinna Vinschen <corinna@vinschen.de>
* fhandler_clipboard.cc (fhandler_dev_clipboard::read): Fix buffer
read access overrun when pos > 0.
2013-06-17 Corinna Vinschen <corinna@vinschen.de>
* times.cc (GetSystemTimePreciseAsFileTime): Add comment to declaration.

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;

View File

@ -8,3 +8,6 @@ Bug fixes:
- Fix long-standing problem which allows to access files via ".." using an
invalid POSIX path, for instance, `cd nonexistant/../existing_dir".
Fixes: http://cygwin.com/ml/cygwin/2013-05/msg00222.html
- Fix EFAULT when reading large clipboard.
Fixes: http://cygwin.com/ml/cygwin/2013-06/msg00311.html