mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-24 01:07:21 +01:00
sh: fix read builtin on 32-bit systems
Specifically, any system with a 32-bit size_t; -residue is calculated as a 32-bit *then* promoted to the 64-bit off_t and the result is ultimately wrong. This resulted in what would appear to be truncated output, as only the first line would be read. Correct it by just making residue an off_t to begin with, since this is what lseek will take anyways. Reported by: antoine, dim Triaged by: cem Tested by: kevans X-MFC-With: r358152
This commit is contained in:
parent
5915b638b0
commit
b63d2d683d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358235
@ -117,7 +117,7 @@ fdgetc(struct fdctx *fdc, char *c)
|
||||
static void
|
||||
fdctx_destroy(struct fdctx *fdc)
|
||||
{
|
||||
size_t residue;
|
||||
off_t residue;
|
||||
|
||||
if (fdc->buflen > 1) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user