From 4533affdf5ae88e4f8dd36f7555516f29c3c842f Mon Sep 17 00:00:00 2001 From: Eric Gallager Date: Fri, 4 Oct 2024 04:02:58 -0400 Subject: [PATCH] Fix code scanning alert no. 683: Suspicious add with sizeof Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/gdb/solib-frv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gdb/solib-frv.c b/src/gdb/solib-frv.c index 4c2496e47..ea7d249e4 100644 --- a/src/gdb/solib-frv.c +++ b/src/gdb/solib-frv.c @@ -139,8 +139,8 @@ fetch_loadmap (CORE_ADDR ldmaddr) memcpy (ext_ldmbuf, &ext_ldmbuf_partial, sizeof ext_ldmbuf_partial); /* Read the rest of the loadmap from the target: */ - if (target_read_memory((ldmaddr + sizeof(ext_ldmbuf_partial)), - (gdb_byte *)(ext_ldmbuf + sizeof(ext_ldmbuf_partial)), + if (target_read_memory(((gdb_byte *)ldmaddr + sizeof(ext_ldmbuf_partial)), + ((gdb_byte *)ext_ldmbuf + sizeof(ext_ldmbuf_partial)), (ext_ldmbuf_size - sizeof(ext_ldmbuf_partial)))) { /* Failed to read rest of the loadmap: */