Use rs->buf after getpkt
authorYao Qi <yao@codesourcery.com>
Mon, 20 Jan 2014 12:56:13 +0000 (20:56 +0800)
committerYao Qi <yao@codesourcery.com>
Wed, 5 Feb 2014 12:25:47 +0000 (20:25 +0800)
commit8dc5b31971ad5dddf5e6efa07cf70d094c1a9fe5
treebc4a4c5e809bfda5c1feff8d3228b7e7a80b32f8
parentde7b2893853cd1122b223a2023fdc35b41a26960
Use rs->buf after getpkt

Hi,
The following code snippet looks wrong to me

 char *buf = rs->buf;

 getpkt (&rs->buf, &rs->buf_size, 0);
 packet_ok (buf, );

if rs->buf is reallocated in getpkt, buf points to an out of dated
memory.  This patch removes local 'buf' and uses rs->buf.

gdb:

2014-02-05  Yao Qi  <yao@codesourcery.com>

* remote.c (remote_pass_signals): Remove local 'buf' and use
rs->buf.
(remote_program_signals): Likewise.
gdb/ChangeLog
gdb/remote.c