Skip to content

Commit

Permalink
Fixed illegal memory access after being freed
Browse files Browse the repository at this point in the history
  • Loading branch information
danpascu committed Oct 16, 2018
1 parent 6be7190 commit e80f2fc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions net/proto_tcp/tcp_common.h
Expand Up @@ -425,15 +425,17 @@ static inline int tcp_handle_req(struct tcp_req *req,
* unallocated memory - razvanc */
*req->parsed=c;
memmove(req->buf, req->parsed, size);
}

#ifdef EXTRA_DEBUG
LM_DBG("preparing for new request, kept %ld bytes\n", size);
LM_DBG("preparing for new request, kept %ld bytes\n", size);
#endif
init_tcp_req(req, size);
con->msg_attempts = 0;
init_tcp_req(req, size);

/* if we still have some unparsed bytes, try to parse them too*/
if (size) return 1;
/* if we still have some unparsed bytes, try to parse them too */
return 1;
}

con->msg_attempts = 0;
} else {
/* request not complete - check the if the thresholds are exceeded */
if (con->msg_attempts==0)
Expand Down

0 comments on commit e80f2fc

Please sign in to comment.