From e6edda56ff6f7bbb6f9ec0a2832d5935428f31c9 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 7 Mar 2011 20:15:12 +0000 Subject: [PATCH] gdb/gdbserver/ * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically. --- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/remote-utils.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 577a14b6f41..3c06909b708 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2011-03-07 Jan Kratochvil + + * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically. + 2011-03-06 Yao Qi * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR). diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index 88ef3470520..650ddf89101 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -725,7 +725,7 @@ putpkt_binary_1 (char *buf, int cnt, int is_notif) char *p; int cc; - buf2 = xmalloc (PBUFSIZ); + buf2 = xmalloc (strlen ("$") + cnt + strlen ("#nn") + 1); /* Copy the packet into buffer BUF2, encapsulating it and giving it a checksum. */ -- 2.30.2