WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] gdbsx: malloc extra bye for null char

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] gdbsx: malloc extra bye for null char
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Oct 2009 04:00:21 -0700
Delivery-date: Mon, 19 Oct 2009 04:00:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1255945763 -3600
# Node ID 24dd0e4261a8aa16d3622f100b8470082ed037e5
# Parent  b84064697e4d59f379a52f1abf13ce80f78a90d8
gdbsx: malloc extra bye for null char

Signed-off-by: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
---
 tools/debugger/gdbsx/gx/gx_comm.c |    1 +
 tools/debugger/gdbsx/gx/gx_main.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff -r b84064697e4d -r 24dd0e4261a8 tools/debugger/gdbsx/gx/gx_comm.c
--- a/tools/debugger/gdbsx/gx/gx_comm.c Mon Oct 19 10:48:47 2009 +0100
+++ b/tools/debugger/gdbsx/gx/gx_comm.c Mon Oct 19 10:49:23 2009 +0100
@@ -299,6 +299,7 @@ gx_putpkt (char *buf)
 
         if (write(remote_fd, buf2, p - buf2) != p - buf2) {
             perror("putpkt(write)");
+            free(buf2);
             return -1;
         }
         if (gx_remote_dbg)
diff -r b84064697e4d -r 24dd0e4261a8 tools/debugger/gdbsx/gx/gx_main.c
--- a/tools/debugger/gdbsx/gx/gx_main.c Mon Oct 19 10:48:47 2009 +0100
+++ b/tools/debugger/gdbsx/gx/gx_main.c Mon Oct 19 10:49:23 2009 +0100
@@ -201,7 +201,7 @@ process_m_request(char *remote_buf)
 
     gx_decode_m_packet(&remote_buf[1], &addr, &len);
 
-    if ((xbuf=malloc(len)) == NULL) {
+    if ((xbuf=malloc(len+1)) == NULL) {
         gx_reply_error(remote_buf);
         return;
     }
@@ -227,7 +227,7 @@ process_M_request(char *remote_buf)
 
     data_strtp = gx_decode_M_packet(&remote_buf[1], &addr, &len);
 
-    if ((xbuf=malloc(len)) == NULL) {
+    if ((xbuf=malloc(len+1)) == NULL) {
         gx_reply_error(remote_buf);
         return;
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] gdbsx: malloc extra bye for null char, Xen patchbot-unstable <=