Sync with upstream r1.7

Tue Apr 8 14:20:01 2014 UTC

"fix an error in the stride calculations. the math only works for
multiples of the stride. don't overwrite past the end of the buffer, and
also save that amount for later so the array is completely filled. ok
deraadt djm

reported by Dmitry Chestnykh (dchest)"

/tedu@/