cfs: fix bad memory deref in rstat (from yk's patch/cfs-rstatctlbug)
This commit is contained in:
parent
f51aa49bb0
commit
70223416cd
1 changed files with 3 additions and 2 deletions
|
@ -646,6 +646,7 @@ rwrite(Mfile *mf)
|
||||||
void
|
void
|
||||||
rstat(Mfile *mf)
|
rstat(Mfile *mf)
|
||||||
{
|
{
|
||||||
|
uchar buf[STATMAX];
|
||||||
Dir d;
|
Dir d;
|
||||||
|
|
||||||
if(statson && ctltest(mf)){
|
if(statson && ctltest(mf)){
|
||||||
|
@ -659,8 +660,8 @@ rstat(Mfile *mf)
|
||||||
d.muid = "none";
|
d.muid = "none";
|
||||||
d.atime = time(nil);
|
d.atime = time(nil);
|
||||||
d.mtime = d.atime;
|
d.mtime = d.atime;
|
||||||
c.rhdr.nstat = convD2M(&d, c.rhdr.stat,
|
c.rhdr.nstat = convD2M(&d, buf, sizeof buf);
|
||||||
sizeof c.rhdr - (c.rhdr.stat - (uchar*)&c.rhdr));
|
c.rhdr.stat = buf;
|
||||||
sendreply(0);
|
sendreply(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue