summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-03-31 20:48:17 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-03-31 20:48:17 +0000
commit984df69a636451e2b536c082c44a7d438893490f (patch)
treedacba1277b7bb5adc0a59b51db1bdd9ac3d15657 /gnu
parent289208c52e760ad80a1bcf33949501e56f77b021 (diff)
workaround a problem in vax; some malloc() order is causing this if among
valid lengths are 0 length malloc's. tested by miod@, deraadt@ ok.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/ld/ld.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c
index 03800d9ba40..d1bf0914d2c 100644
--- a/gnu/usr.bin/ld/ld.c
+++ b/gnu/usr.bin/ld/ld.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ld.c,v 1.20 2002/02/26 06:26:38 fgsch Exp $ */
+/* $OpenBSD: ld.c,v 1.21 2002/03/31 20:48:16 fgsch Exp $ */
/* $NetBSD: ld.c,v 1.52 1998/02/20 03:12:51 jonathan Exp $ */
/*-
@@ -1191,7 +1191,7 @@ read_entry_relocation(fd, entry)
if (!entry->textrel) {
reloc = (struct relocation_info *)
- xmalloc(entry->header.a_trsize);
+ xmalloc(MAX(entry->header.a_trsize, 1));
pos = text_offset(entry) +
entry->header.a_text + entry->header.a_data;
@@ -1214,7 +1214,7 @@ read_entry_relocation(fd, entry)
if (!entry->datarel) {
reloc = (struct relocation_info *)
- xmalloc(entry->header.a_drsize);
+ xmalloc(MAX(entry->header.a_drsize, 1));
pos = text_offset(entry) + entry->header.a_text +
entry->header.a_data + entry->header.a_trsize;