aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-11-08 12:12:08 +1030
committerAlan Modra <amodra@gmail.com>2014-11-08 12:40:09 +1030
commitd1f5d98a185f0a6f026d265d5bf463f1f91c1256 (patch)
tree923c061a18c53b22531eb0cd29c2c9b7885e8b04 /bfd/peXXigen.c
parentbda749187388ff9f7f500142c772b676a5f10acb (diff)
downloadgdb-d1f5d98a185f0a6f026d265d5bf463f1f91c1256.zip
gdb-d1f5d98a185f0a6f026d265d5bf463f1f91c1256.tar.gz
gdb-d1f5d98a185f0a6f026d265d5bf463f1f91c1256.tar.bz2
Correct buffer overrun test
* peXXigen.c (pe_print_idata): Revert last patch, cast lhs instead.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 2b63e2a..ea1459b 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -1467,7 +1467,7 @@ pe_print_idata (bfd * abfd, void * vfile)
member_high, member,
WithoutHighBit (member_high), member);
/* PR binutils/17512: Handle corrupt PE data. */
- else if (member - adj + 2 >= (unsigned long) datasize)
+ else if ((bfd_vma) member - adj + 2 >= datasize)
fprintf (file, _("\t<corrupt: 0x%04lx>"), member);
else
{
@@ -1502,7 +1502,7 @@ pe_print_idata (bfd * abfd, void * vfile)
fprintf (file, "\t%04lx\t %4lu <none>",
member, WithoutHighBit (member));
/* PR binutils/17512: Handle corrupt PE data. */
- else if (member - adj + 2 >= (unsigned long) datasize)
+ else if ((bfd_vma) member - adj + 2 >= datasize)
fprintf (file, _("\t<corrupt: 0x%04lx>"), member);
else
{