gdb/gdbserver/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 7 Mar 2011 20:15:12 +0000 (20:15 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 7 Mar 2011 20:15:12 +0000 (20:15 +0000)
* remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.

gdb/gdbserver/ChangeLog
gdb/gdbserver/remote-utils.c

index 577a14b..3c06909 100644 (file)
@@ -1,3 +1,7 @@
+2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
+
 2011-03-06  Yao Qi  <yao@codesourcery.com>
 
        * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
index 88ef347..650ddf8 100644 (file)
@@ -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.  */