CID 420802: Avoid NULL deref.

This commit is contained in:
christos 2016-02-26 16:28:14 +00:00
parent 29b05d6a28
commit 0e580577fe

View File

@ -334,7 +334,7 @@ sec_merge_emit (bfd *abfd, struct sec_merge_hash_entry *entry,
/* Trailing alignment needed? */ /* Trailing alignment needed? */
off = sec->size - off; off = sec->size - off;
if (off != 0) if (pad != NULL && off != 0)
{ {
if (contents) if (contents)
memcpy (contents + offset, pad, off); memcpy (contents + offset, pad, off);