]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: clipboard: Fix a bug in read().
authorTakashi Yano <takashi.yano@nifty.ne.jp>
Tue, 7 Dec 2021 13:25:34 +0000 (22:25 +0900)
committerTakashi Yano <takashi.yano@nifty.ne.jp>
Tue, 7 Dec 2021 14:38:50 +0000 (23:38 +0900)
- 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

winsup/cygwin/fhandler_clipboard.cc
winsup/cygwin/release/3.3.4 [new file with mode: 0644]

index 0b87dd352b5a295ba4e58a928ace82f907aa640e..05f54ffb327a2e9feb2165a32ddf43b237105ec8 100644 (file)
@@ -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 (file)
index 0000000..f1c32a1
--- /dev/null
@@ -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
This page took 0.035148 seconds and 5 git commands to generate.