diff options
author | aiju <devnull@localhost> | 2017-04-28 18:45:32 +0000 |
---|---|---|
committer | aiju <devnull@localhost> | 2017-04-28 18:45:32 +0000 |
commit | 7cc9d944df78deb70230b74285287ef429ca14c1 (patch) | |
tree | f7cf610168c3d770b8ef4324882b0d1ab5fc6340 /sys/src/cmd/sshfs.c | |
parent | 5ce3f70f72317e6a1dc387afd1023c99f6186afb (diff) |
sshfs: reset SReq->reqid field to fix double-free of request ids
Diffstat (limited to 'sys/src/cmd/sshfs.c')
-rw-r--r-- | sys/src/cmd/sshfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/src/cmd/sshfs.c b/sys/src/cmd/sshfs.c index b3cbbfe1d..e65912133 100644 --- a/sys/src/cmd/sshfs.c +++ b/sys/src/cmd/sshfs.c @@ -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){ |