aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-07-11 08:14:57 +0200
committerJan Beulich <jbeulich@suse.com>2023-07-11 08:14:57 +0200
commiteb70d820e85d1a10c3838088c4b551eef01efa61 (patch)
tree6d16bbff6a54a248f0267414509a449c967c69d2
parentc4fb288bbbe28b67534094365ada28f5de85e3ae (diff)
downloadgdb-eb70d820e85d1a10c3838088c4b551eef01efa61.zip
gdb-eb70d820e85d1a10c3838088c4b551eef01efa61.tar.gz
gdb-eb70d820e85d1a10c3838088c4b551eef01efa61.tar.bz2
ld/PDB: fix off-by-1 in add_globals_ref()
Copying one too many bytes can corrupt memory, detected/reported by glibc on a 32-bit distro.
-rw-r--r--ld/pdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/pdb.c b/ld/pdb.c
index 5e85f99..267da50 100644
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -880,7 +880,7 @@ add_globals_ref (struct globals *glob, bfd *sym_rec_stream, const char *name,
g->offset = bfd_tell (sym_rec_stream);
g->hash = hash;
g->refcount = 1;
- memcpy (g->data, data, len + 1);
+ memcpy (g->data, data, len);
glob->num_entries++;