This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] check return from bfd_make_section
- From: msnyder at sonic dot net
- To: binutils at sourceware dot org
- Date: Wed, 25 Jul 2007 14:32:57 -0700 (PDT)
- Subject: [patch] check return from bfd_make_section
Usually gets checked. Ptr will be dereferenced.
2007-07-25 Michael Snyder <msnyder@access-company.com>
* tekhex.c (first_phase): Check return value for null.
Index: tekhex.c
===================================================================
RCS file: /cvs/src/src/bfd/tekhex.c,v
retrieving revision 1.32
diff -p -r1.32 tekhex.c
*** tekhex.c 3 Jul 2007 14:26:42 -0000 1.32
--- tekhex.c 25 Jul 2007 21:31:17 -0000
*************** first_phase (bfd *abfd, int type, char *
*** 389,394 ****
--- 389,396 ----
return FALSE;
memcpy (n, sym, len + 1);
section = bfd_make_section (abfd, n);
+ if (section == NULL)
+ return FALSE;
}
while (*src)
{