From: Benjamin Herrenschmidt Date: Thu, 28 May 2020 14:04:46 +0000 (+1000) Subject: mw_debug: Fix memory overflow with "sim" backend X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8df0647fd40d6724a236d6ace5c63568fca3241;p=microwatt.git mw_debug: Fix memory overflow with "sim" backend Signed-off-by: Benjamin Herrenschmidt --- diff --git a/scripts/mw_debug/mw_debug.c b/scripts/mw_debug/mw_debug.c index fec9722..8999c8c 100644 --- a/scripts/mw_debug/mw_debug.c +++ b/scripts/mw_debug/mw_debug.c @@ -176,7 +176,7 @@ static int sim_command(uint8_t op, uint8_t addr, uint64_t *data) printf("\n"); } write(sim_fd, buf, p - buf); - r = read(sim_fd, buf, 127); + r = read(sim_fd, buf, sizeof(buf)); if (0 && r > 0) { int i;