On Sat, 14 May 2016 12:59:20 -0400, "Ted Unangst" wrote:

> Theo de Raadt wrote:
> > > Mark Kettenis wrote:
> > > > CVSROOT:        /cvs
> > > > Module name:    src
> > > > Changes by:     kette...@cvs.openbsd.org        2016/05/14 08:24:54
> > > > 
> > > > Modified files:
> > > >         lib/libkvm     : kvm.c 
> > > > 
> > > > Log message:
> > > > Revert previous commit.  Converting bcopy into memcpy is never safe whe
> n
> > > > there is a big fat comment saying "Avoid alignment issues" immediately
> > > > above them.
> > > 
> > > what? memcpy works on unaligned memory just fine.
> > > 
> > 
> > not when the compiler thinks "hey i can do this myself, and i am damn
> > sure it is aligned".
> > 
> > then memcpy/memmove fail, whereas bcopy works.
> 
> ok, so the real problem here is that we're creating unaligned pointers. this
> is illegal C even when calling bcopy, we just get away with it. *for now.*
> 
> fix that first by avoiding unsafe casts.

Hah, I have almost the same diff.

 - todd

Reply via email to