Browse Source

Fix a potential out of bound access. #1465

pull/752/merge
Max Lv 7 years ago
parent
commit
9ee82a9a89
1 changed files with 1 additions and 2 deletions
  1. 3
      src/server.c

3
src/server.c

@ -1041,8 +1041,7 @@ server_resolve_cb(struct sockaddr *addr, void *data)
// XXX: should handle buffer carefully
if (server->buf->len > 0) {
memcpy(remote->buf->data, server->buf->data + server->buf->idx,
server->buf->len);
memcpy(remote->buf->data, server->buf->data, server->buf->len);
remote->buf->len = server->buf->len;
remote->buf->idx = 0;
server->buf->len = 0;

Loading…
Cancel
Save