summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-02-22 03:14:05 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-02-22 03:14:05 +0000
commitb63d2d683ddbbfc066fb4653b2e37e6c58875d6d (patch)
treeca7a24754ecd40dccea50af8ba9f509fb53e5acb /bin
parent5915b638b0ad347e28ec43112d994498f7cf0d4f (diff)
downloadsrc-test2-b63d2d683ddbbfc066fb4653b2e37e6c58875d6d.tar.gz
src-test2-b63d2d683ddbbfc066fb4653b2e37e6c58875d6d.zip
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
Notes
Notes: svn path=/head/; revision=358235
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/miscbltin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c
index ad3d862fb6ef..a49dd05d109f 100644
--- a/bin/sh/miscbltin.c
+++ b/bin/sh/miscbltin.c
@@ -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) {
/*