diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc index 0b87dd352..05f54ffb3 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 000000000..f1c32a1a5 --- /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