* fhandler_clipboard.cc (fhandler_dev_clipboard::open): Drop gratuitios
handling of membuffer. It's NULL anyway. (fhandler_dev_clipboard::lseek): Set membuffer to NULL after freeing it to avoid subsequent crashes when accessing invalid pointer.
This commit is contained in:
parent
494c626414
commit
f0b101007a
|
@ -1,3 +1,10 @@
|
||||||
|
2013-10-25 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_clipboard.cc (fhandler_dev_clipboard::open): Drop gratuitios
|
||||||
|
handling of membuffer. It's NULL anyway.
|
||||||
|
(fhandler_dev_clipboard::lseek): Set membuffer to NULL after freeing
|
||||||
|
it to avoid subsequent crashes when accessing invalid pointer.
|
||||||
|
|
||||||
2013-10-25 Corinna Vinschen <corinna@vinschen.de>
|
2013-10-25 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* devices.in (dev_storage): Map /dev/random and /dev/urandom to
|
* devices.in (dev_storage): Map /dev/random and /dev/urandom to
|
||||||
|
|
|
@ -69,9 +69,6 @@ fhandler_dev_clipboard::open (int flags, mode_t)
|
||||||
{
|
{
|
||||||
set_flags (flags | O_TEXT);
|
set_flags (flags | O_TEXT);
|
||||||
pos = 0;
|
pos = 0;
|
||||||
if (membuffer)
|
|
||||||
free (membuffer);
|
|
||||||
membuffer = NULL;
|
|
||||||
if (!cygnativeformat)
|
if (!cygnativeformat)
|
||||||
cygnativeformat = RegisterClipboardFormatW (CYGWIN_NATIVE);
|
cygnativeformat = RegisterClipboardFormatW (CYGWIN_NATIVE);
|
||||||
nohandle (true);
|
nohandle (true);
|
||||||
|
@ -336,7 +333,10 @@ fhandler_dev_clipboard::lseek (off_t offset, int whence)
|
||||||
pos = offset;
|
pos = offset;
|
||||||
/* treat seek like rewind */
|
/* treat seek like rewind */
|
||||||
if (membuffer)
|
if (membuffer)
|
||||||
free (membuffer);
|
{
|
||||||
|
free (membuffer);
|
||||||
|
membuffer = NULL;
|
||||||
|
}
|
||||||
msize = 0;
|
msize = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,3 +26,5 @@ Bug fixes:
|
||||||
|
|
||||||
- Properly set process sid rather than always using -1.
|
- Properly set process sid rather than always using -1.
|
||||||
Fixes: http://cygwin.com/ml/cygwin/2013-10/threads.html#00237
|
Fixes: http://cygwin.com/ml/cygwin/2013-10/threads.html#00237
|
||||||
|
|
||||||
|
- Fix a potential crash after calling lseek on /dev/clipboard.
|
||||||
|
|
Loading…
Reference in New Issue