Text handling broke.

Duane junkmail at junkmail.com
Sun Feb 4 22:11:27 CST 2001


Dmitry Timoshkov wrote:
> 
> "Duane" <junkmail at junkmail.com> wrote:
> 
> > As mentioned elsewhere, I did try this patch, but still had the problem.
> > So I stuck a couple of trace messages into EDIT_EM_GetLine() and ran the
> > program some more. I entering a string of four characters into the text
> > dialog, and found that EDIT_EM_GetLine() was entered with the unicode
> > boolean set, EDIT_EM_LineLength returned four and set len accordingly,
> > and then the for loop was entered and four characters were copied from
> > src to lpch.
> >
> > Under the theory (which I have no idea whether it is right) that I also
> > needed to copy the terminating '\0', I changed the loop termination test
> > from
> >   i < len
> > to
> >   i <= len
> >
> > So that for my 4 character string, it would copy 5 characters. And that
> > seems to have worked, at least in my case, though I have no idea whether
> > that might impact something else.
> 
> This is could easy overwrite some data in your program, if the passed
> buffer is not large enough.
> 
> Please try the attached patch, it should solve your problem.
> 

Yep, that seems to work fine. Thanks.

--
My real email is akamail.com at dclark (or something like that).



More information about the wine-users mailing list