[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#159633: strncpy on alpha/libc broken

On Mon, Sep 09, 2002 at 12:36:51PM +1000, Herbert Xu wrote:
> On Sun, Sep 08, 2002 at 10:02:48PM -0400, Daniel Jacobowitz wrote:
> >
> > > OK, I see what you mean now.  However, there is still another SEGV
> > > to fix.  The first jump to u_head could cause two loads even if you're
> > > just copying one byte.
> > 
> > I think I forgot to CC you - did you see my followup patch?  It's not
> I was referring to that patch in the previous message.  In the misaligned
> case, the code will always do two 8-byte loads if the dest misalignment
> is greater than the src misalignment even with your patch applied.
> This will segfault when count == 1 and src is on a page boundary.
> Another check needs to be added before the first branch to $u_head
> to fix this.

I'm not sure I understand what you mean, although it sounds
reasonable.... could you give me an affected test, so that I can add it
to the testsuite?  Are you talking about a page boundary before or
after src?

It will do two loads if the dest alignment is greater than the source
misalignment - but they turn out to be the _same_ memory location.

Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

Reply to: