Created
October 3, 2017 14:27
-
-
Save theorbtwo/d98ccb31f7a47b6b2bd72024a27ca607 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 6c0edea89a5e98ec929f1431861e3f1df1f81e77 | |
Author: James Mastros <james@mastros.biz> | |
Date: Mon Sep 18 23:26:21 2017 +0000 | |
In gdb_get_target_description_chunk, only allocate a buffer as large as needed at EOF. | |
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c | |
index 483e551..8ebf0e7 100644 | |
--- a/src/server/gdb_server.c | |
+++ b/src/server/gdb_server.c | |
@@ -2215,8 +2215,11 @@ static int gdb_get_target_description_chunk(struct target *target, struct target | |
if (length < (tdesc_length - offset)) | |
transfer_type = 'm'; | |
- else | |
- transfer_type = 'l'; | |
+ else { | |
+ transfer_type = 'l'; | |
+ length = tdesc_length - offset; | |
+ } | |
+ | |
*chunk = malloc(length + 2); | |
if (*chunk == NULL) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment