+2017-06-15 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/21579
+ * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
+
2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
* elf32-xtensa.c (elf_xtensa_be_plt_entry,
ptr += 4;
-#if VMS_DEBUG
- _bfd_vms_debug (4, "etir: %s(%d)\n",
- _bfd_vms_etir_name (cmd), cmd);
- _bfd_hexdump (8, ptr, cmd_length - 4, 0);
-#endif
-
- /* PR 21589: Check for a corrupt ETIR record. */
- if (cmd_length < 4)
+ /* PR 21589 and 21579: Check for a corrupt ETIR record. */
+ if (cmd_length < 4 || (ptr + cmd_length > maxptr + 4))
{
corrupt_etir:
_bfd_error_handler (_("Corrupt ETIR record encountered"));
return FALSE;
}
+#if VMS_DEBUG
+ _bfd_vms_debug (4, "etir: %s(%d)\n",
+ _bfd_vms_etir_name (cmd), cmd);
+ _bfd_hexdump (8, ptr, cmd_length - 4, 0);
+#endif
+
switch (cmd)
{
/* Stack global