openbsd-ports/devel/gdb/patches/patch-bfd_peXXigen_c
2014-08-14 07:50:24 +00:00

23 lines
860 B
Plaintext

$OpenBSD: patch-bfd_peXXigen_c,v 1.3 2014/08/14 07:50:24 pascal Exp $
Fix out-of-bounds memcpys (FILNMLEN is 18, sizeof x_fname is 14).
--- bfd/peXXigen.c.orig Tue Jul 29 14:37:42 2014
+++ bfd/peXXigen.c Tue Jul 29 20:27:50 2014
@@ -292,7 +292,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:
@@ -366,7 +366,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;