summaryrefslogtreecommitdiff
path: root/fs.h
diff options
context:
space:
mode:
authorAustin Clements <[email protected]>2015-03-24 20:54:39 -0400
committerAustin Clements <[email protected]>2015-03-24 20:54:39 -0400
commit7443b9649a6d83443439ae95458434038313b42b (patch)
treed3e9af53dd008ef83c79511a9b65ce5383b00dca /fs.h
parent3d2dedd42714fc4eb7844b17b62669e287f27583 (diff)
downloadxv6-labs-7443b9649a6d83443439ae95458434038313b42b.tar.gz
xv6-labs-7443b9649a6d83443439ae95458434038313b42b.tar.bz2
xv6-labs-7443b9649a6d83443439ae95458434038313b42b.zip
Fix missing NUL-terminator in grep
Currently, grep read()s into a buffer and then uses the buffer as a string. Since there's no NUL-terminator, this can cause it to falsely identify line breaks and matches from leftover data on earlier lines and, if a line fills up the entire buffer, to read past the end of the buffer. Fix this by NUL-terminating any data returned by read(). Thanks to Keiichi Watanabe for the report.
Diffstat (limited to 'fs.h')
0 files changed, 0 insertions, 0 deletions