mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
viced cap fetchdata len to avoid negative
when trying to read from a short or zero length file, it's possible for sanity checking to knock the length below zero. set a floor at zero. Reviewed-on: http://gerrit.openafs.org/494 Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
bc6559d62c
commit
529d487d65
@ -7027,8 +7027,9 @@ FetchData_RXStyle(Volume * volptr, Vnode * targetptr,
|
||||
Len = 0;
|
||||
}
|
||||
|
||||
if (Pos + Len > tlen)
|
||||
Len = tlen - Pos; /* get length we should send */
|
||||
if (Pos + Len > tlen) /* get length we should send */
|
||||
Len = ((tlen - Pos) < 0) ? 0 : tlen - Pos;
|
||||
|
||||
(void)FDH_SEEK(fdP, Pos, 0);
|
||||
{
|
||||
afs_int32 high, low;
|
||||
|
Loading…
Reference in New Issue
Block a user