aboutsummaryrefslogtreecommitdiffstats
path: root/tools/debugger/gdbsx/gx/gx_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debugger/gdbsx/gx/gx_main.c')
-rw-r--r--tools/debugger/gdbsx/gx/gx_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/debugger/gdbsx/gx/gx_main.c b/tools/debugger/gdbsx/gx/gx_main.c
index f20f6ef0d7..07923af973 100644
--- a/tools/debugger/gdbsx/gx/gx_main.c
+++ b/tools/debugger/gdbsx/gx/gx_main.c
@@ -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;
}