devproc: make sure statbufread offset wont turn negative

This commit is contained in:
cinap_lenrek 2015-07-15 17:09:05 +02:00
parent ea7bca1829
commit bae3ac29fc

View file

@ -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;