sshfs: reset SReq->reqid field to fix double-free of request ids
This commit is contained in:
parent
5ce3f70f72
commit
7cc9d944df
1 changed files with 3 additions and 2 deletions
|
@ -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){
|
||||
|
|
Loading…
Reference in a new issue