sshfs: reset SReq->reqid field to fix double-free of request ids

This commit is contained in:
aiju 2017-04-28 18:45:32 +00:00
parent 5ce3f70f72
commit 7cc9d944df

View file

@ -938,18 +938,19 @@ recvproc(void *)
}
id = GET4(rxpkt + 1);
if(id >= MAXREQID){
fprint(2, "sshfs: received response with id out of range, %d > %d\n", id, MAXREQID);
fprint(2, "sshfs: received response with id out of range, %d > %d\n", t, id, MAXREQID);
continue;
}
qlock(&sreqidlock);
r = sreqrd[id];
if(r != nil){
sreqrd[id] = nil;
r->reqid = -1;
rwakeup(&sreqidrend);
}
qunlock(&sreqidlock);
if(r == nil){
fprint(2, "sshfs: received response to non-existent request (req id = %d)\n", id);
fprint(2, "sshfs: received response to non-existent request (req id = %d)\n", t, id);
continue;
}
if(r->closefid != nil){