diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2021-12-07 22:25:34 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2021-12-07 23:38:50 +0900 |
commit | 69ed8ca20c6bf0c92cefac6bcb761f2b7261b9c4 (patch) | |
tree | 2b4b5e0b42ae49fa54bf56fa4edb44110835832c | |
parent | a4705d387f7874f9a5de3ee67861773a17691643 (diff) | |
download | newlib-69ed8ca20c6bf0c92cefac6bcb761f2b7261b9c4.zip newlib-69ed8ca20c6bf0c92cefac6bcb761f2b7261b9c4.tar.gz newlib-69ed8ca20c6bf0c92cefac6bcb761f2b7261b9c4.tar.bz2 |
Cygwin: clipboard: Fix a bug in read().
- Fix a bug in fhandler_dev_clipboard::read() that the second read
fails with 'Bad address'.
Addresses:
https://cygwin.com/pipermail/cygwin/2021-December/250141.html
-rw-r--r-- | winsup/cygwin/fhandler_clipboard.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/release/3.3.4 | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc index 0b87dd3..05f54ff 100644 --- a/winsup/cygwin/fhandler_clipboard.cc +++ b/winsup/cygwin/fhandler_clipboard.cc @@ -229,7 +229,7 @@ fhandler_dev_clipboard::read (void *ptr, size_t& len) if (pos < (off_t) clipbuf->cb_size) { ret = (len > (clipbuf->cb_size - pos)) ? clipbuf->cb_size - pos : len; - memcpy (ptr, &clipbuf[1] + pos , ret); + memcpy (ptr, (char *) (clipbuf + 1) + pos, ret); pos += ret; } } diff --git a/winsup/cygwin/release/3.3.4 b/winsup/cygwin/release/3.3.4 new file mode 100644 index 0000000..f1c32a1 --- /dev/null +++ b/winsup/cygwin/release/3.3.4 @@ -0,0 +1,6 @@ +Bug Fixes +--------- + +- Fix a bug in fhandler_dev_clipboard::read() that the second read + fails with 'Bad address'. + Addresses: https://cygwin.com/pipermail/cygwin/2021-December/250141.html |