devproc: make sure statbufread offset wont turn negative
This commit is contained in:
parent
ea7bca1829
commit
bae3ac29fc
1 changed files with 1 additions and 1 deletions
|
@ -995,7 +995,7 @@ procread(Chan *c, void *va, long n, vlong off)
|
||||||
qunlock(&p->debug);
|
qunlock(&p->debug);
|
||||||
poperror();
|
poperror();
|
||||||
|
|
||||||
if(i <= 0)
|
if(i <= 0 || i > j)
|
||||||
return 0;
|
return 0;
|
||||||
if(i < n)
|
if(i < n)
|
||||||
n = i;
|
n = i;
|
||||||
|
|
Loading…
Reference in a new issue