From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 8B6E93858D3C; Tue, 7 Dec 2021 14:54:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B6E93858D3C Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: clipboard: Fix a bug in read(). X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: a4705d387f7874f9a5de3ee67861773a17691643 X-Git-Newrev: 69ed8ca20c6bf0c92cefac6bcb761f2b7261b9c4 Message-Id: <20211207145416.8B6E93858D3C@sourceware.org> Date: Tue, 7 Dec 2021 14:54:16 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2021 14:54:16 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=69ed8ca20c6bf0c92cefac6bcb761f2b7261b9c4 commit 69ed8ca20c6bf0c92cefac6bcb761f2b7261b9c4 Author: Takashi Yano Date: Tue Dec 7 22:25:34 2021 +0900 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 Diff: --- winsup/cygwin/fhandler_clipboard.cc | 2 +- winsup/cygwin/release/3.3.4 | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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