openbsd-ports/devel/gdb/patches/patch-bfd_peXXigen_c
2014-03-09 19:49:21 +00:00

23 lines
860 B
Plaintext

$OpenBSD: patch-bfd_peXXigen_c,v 1.2 2014/03/09 19:49:21 pascal Exp $
Fix out-of-bounds memcpys (FILNMLEN is 18, sizeof x_fname is 14).
--- bfd/peXXigen.c.orig Wed Jan 8 10:23:36 2014
+++ bfd/peXXigen.c Fri Feb 7 18:43:41 2014
@@ -256,7 +256,7 @@ _bfd_XXi_swap_aux_in (bfd * abfd,
in->x_file.x_n.x_offset = H_GET_32 (abfd, ext->x_file.x_n.x_offset);
}
else
- memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname, sizeof in->x_file.x_fname);
return;
case C_STAT:
@@ -330,7 +330,7 @@ _bfd_XXi_swap_aux_out (bfd * abfd,
H_PUT_32 (abfd, in->x_file.x_n.x_offset, ext->x_file.x_n.x_offset);
}
else
- memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
+ memcpy (ext->x_file.x_fname, in->x_file.x_fname, sizeof ext->x_file.x_fname);
return AUXESZ;