From 67fbb458165c60e7149d81555e8144a8ad4b0191 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 5 Oct 2022 12:00:57 -0700 Subject: [PATCH] rdoff/ldrdf.c: fix memory overflow errors causing build failures The RDOFF tools are fundamentally broken to the core: they are defining headers which contain misaligned structure members, which cause the compiler to add padding, breaking the format. This is just a build fix; remove RDOFF in 2.16. Signed-off-by: H. Peter Anvin --- rdoff/ldrdf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rdoff/ldrdf.c b/rdoff/ldrdf.c index a78c45046..f45294dbe 100644 --- a/rdoff/ldrdf.c +++ b/rdoff/ldrdf.c @@ -735,7 +735,7 @@ static void write_output(const char *filename) printf("\nadding generic record from binary file %s\n", generic_rec_file); - hr = (rdfheaderrec *) nasm_malloc(sizeof(struct GenericRec)); + nasm_new(hr); if ((ff = fopen(generic_rec_file, "r")) == NULL) { fprintf(stderr, "ldrdf: couldn't open %s for input\n", generic_rec_file); @@ -772,7 +772,7 @@ static void write_output(const char *filename) if (options.verbose) printf("\nadding module name record %s\n", modname_specified); - hr = (rdfheaderrec *) nasm_malloc(sizeof(struct ModRec)); + nasm_new(hr); hr->m.type = RDFREC_MODNAME; hr->m.reclen = n + 1; strcpy(hr->m.modname, modname_specified);