HomeFreeBSD

MFC r305406,r305409,r305412

Description

MFC r305406,r305409,r305412

  1. Fix errors handling.
  1. Prevent out of bounds access to ws[-1] (passed buffer) which happens

when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.

  1. Fix n == 1 case. Here should be no physical read (fill buffer) attempt

(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.

Details

Provenance
acheAuthored on
Parents
rS305576: Fix typo in skein amd64 assembly
Branches
Unknown
Tags
Unknown