+2021-04-21 Nick Clifton <nickc@redhat.com>
+
+ PR 27759
+ * srec.c (srec_read_section): Replace assertions with error
+ returns.
+
2021-04-20 Clément Chigot <clement.chigot@atos.net>
PR binutils/21700
/* This is called after srec_scan has already been called, so we
ought to know the exact format. */
- BFD_ASSERT (c == 'S');
+ if (c != 'S')
+ goto error_return;
if (bfd_bread (hdr, (bfd_size_type) 3, abfd) != 3)
goto error_return;
switch (hdr[0])
{
default:
- BFD_ASSERT (sofar == section->size);
+ if (sofar != section->size)
+ goto error_return;
free (buf);
return true;
if (address != section->vma + sofar)
{
/* We've come to the end of this section. */
- BFD_ASSERT (sofar == section->size);
+ if (sofar != section->size)
+ goto error_return;
free (buf);
return true;
}
if (error)
goto error_return;
- BFD_ASSERT (sofar == section->size);
+ if (sofar != section->size)
+ goto error_return;
free (buf);
return true;