+2019-02-20 Alan Modra <amodra@gmail.com>
+
+ PR 24225
+ * elf32-nios2.c (nios2_elf32_relocate_section): Check asprintf
+ return value.
+
2019-02-20 Michael Roitzsch <reactorcontrol@icloud.com>
* configure.ac (SHARED_LIBADD): Add -liberty -lintl for all
format = _("global pointer relative relocation at address "
"%#" PRIx64 " when _gp not defined\n");
- asprintf (&msgbuf, format, (uint64_t) reloc_address);
+ if (asprintf (&msgbuf, format,
+ (uint64_t) reloc_address) == -1)
+ msgbuf = NULL;
msg = msgbuf;
r = bfd_reloc_dangerous;
}
"the global pointer (at %#" PRIx64 ") "
"because the offset (%" PRId64 ") is out of "
"the allowed range, -32678 to 32767\n" );
- asprintf (&msgbuf, format, name,
- (uint64_t) symbol_address, (uint64_t) gp,
- (int64_t) relocation);
+ if (asprintf (&msgbuf, format, name,
+ (uint64_t) symbol_address, (uint64_t) gp,
+ (int64_t) relocation) == -1)
+ msgbuf = NULL;
msg = msgbuf;
r = bfd_reloc_outofrange;
}