public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: getclip and cygutils and cygcheck
Date: Mon, 17 Jun 2013 10:16:00 -0000	[thread overview]
Message-ID: <20130617101633.GC21191@calimero.vinschen.de> (raw)
In-Reply-To: <CAOh4nmkU4ydx1FTxcL11OV3sUG9Qdb1RnLjV-x7KwOVW34Kciw@mail.gmail.com>

On Jun 14 23:15, Jeremy Hetzler wrote:
> On Fri, Jun 14, 2013 at 5:15 AM, Corinna Vinschen wrote:
> 
> > What's that size?  I'm not aware of any size restriction in the current
> > /dev/clipboard code.  Well, there's an allocation when writing to the
> > clipboard, but it's only restricted by the size of the largest available
> > memory block in the process VM, in theory.
> 
> After some testing, the limit seems to be 64k. It only happens when
> reading data that was copied to the clipboard by a Windows program (in
> this case Excel).
> 
> Steps:
> - Open attached file in Excel
> - Ctrl-a to select all, ctrl-c to copy to clipboard
> - Then:
> 
> 582 $ getclip >out.gc
> 
> 583 $ cat /dev/clipboard >out.cat
> cat: /dev/clipboard: Bad address
> 
> 584 $ wc /dev/clipboard
> wc: /dev/clipboard: Bad address
>     400   13526   65536 /dev/clipboard
> 
> 585 $ ls -la out*
> -rw-r--r--+ 1 jhetzler Domain Users 65536 Jun 14 23:03 out.cat
> -rw-r--r--+ 1 jhetzler Domain Users 73922 Jun 14 23:03 out.gc
> 
> This is 1.7.20 on 64-bit Windows 7 and Excel 2013.
> 
> Does that help?

Yes, thank you.  There was an ill-conceived check for the last character
in the buffer being a high surrogate UTF-16 character.  It worked only
if the clipboard content was small enough to fit into a single read of
the application.  If it was too big, and the application had to call
read again to fetch more from the clipboard, it tried to read the
character beyond the array boundary.  I fixed that in CVS.  I'll probably
create a new developer snapshot and a 64 bit test version later today.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2013-06-17 10:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 14:48 Nellis, Kenneth
2013-06-12 15:22 ` Nellis, Kenneth
2013-06-12 15:40   ` Corinna Vinschen
2013-06-12 17:57   ` Christopher Faylor
2013-06-12 19:53   ` Thomas Wolff
2013-06-13  9:56     ` Corinna Vinschen
2013-06-13 18:13       ` Jeremy Hetzler
2013-06-14  9:16         ` Corinna Vinschen
2013-06-15  3:15           ` Jeremy Hetzler
2013-06-15  3:36             ` Jeremy Hetzler
2013-06-15 17:45               ` Arthur Tu
2013-06-15 19:36             ` Thomas Wolff
2013-06-17 10:16             ` Corinna Vinschen [this message]
2013-06-17 13:13               ` Corinna Vinschen
2013-06-19 17:30                 ` Corinna Vinschen
2013-06-19 17:35                   ` Jeremy Hetzler
2013-06-19 17:45                     ` Corinna Vinschen
2013-06-19 17:11         ` Ken Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130617101633.GC21191@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).