cfs: fix bad memory deref in rstat (from yk's patch/cfs-rstatctlbug)
parent
f51aa49bb0
commit
70223416cd
|
@ -646,6 +646,7 @@ rwrite(Mfile *mf)
|
|||
void
|
||||
rstat(Mfile *mf)
|
||||
{
|
||||
uchar buf[STATMAX];
|
||||
Dir d;
|
||||
|
||||
if(statson && ctltest(mf)){
|
||||
|
@ -659,8 +660,8 @@ rstat(Mfile *mf)
|
|||
d.muid = "none";
|
||||
d.atime = time(nil);
|
||||
d.mtime = d.atime;
|
||||
c.rhdr.nstat = convD2M(&d, c.rhdr.stat,
|
||||
sizeof c.rhdr - (c.rhdr.stat - (uchar*)&c.rhdr));
|
||||
c.rhdr.nstat = convD2M(&d, buf, sizeof buf);
|
||||
c.rhdr.stat = buf;
|
||||
sendreply(0);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue