From 3bb321df71bddd2fb8c444a3b18919941b5ace3a Mon Sep 17 00:00:00 2001
From: dd86k
Date: Thu, 6 Jun 2024 07:48:06 -0400
Subject: [PATCH] object: Change malloc to calloc for lx, ne internals
---
src/adbg/object/format/lx.d | 2 +-
src/adbg/object/format/ne.d | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/adbg/object/format/lx.d b/src/adbg/object/format/lx.d
index 32f47c68..9d891559 100644
--- a/src/adbg/object/format/lx.d
+++ b/src/adbg/object/format/lx.d
@@ -372,7 +372,7 @@ int adbg_object_lx_load(adbg_object_t *o, uint e_lfanew) {
version (Trace) trace("o=%p", o);
o.format = AdbgObject.lx;
- o.internal = malloc(internal_lx_t.sizeof);
+ o.internal = calloc(1, internal_lx_t.sizeof);
if (o.internal == null)
return adbg_oops(AdbgError.crt);
if (adbg_object_read_at(o, e_lfanew, o.internal, lx_header_t.sizeof) < 0)
diff --git a/src/adbg/object/format/ne.d b/src/adbg/object/format/ne.d
index eb4eb96c..1898a10a 100644
--- a/src/adbg/object/format/ne.d
+++ b/src/adbg/object/format/ne.d
@@ -326,7 +326,7 @@ int adbg_object_ne_load(adbg_object_t *o, uint e_lfanew) {
version (Trace) trace("o=%p", o);
o.format = AdbgObject.ne;
- o.internal = malloc(internal_ne_t.sizeof);
+ o.internal = calloc(1, internal_ne_t.sizeof);
if (o.internal == null)
return adbg_oops(AdbgError.crt);
if (adbg_object_read_at(o, e_lfanew, o.internal, ne_header_t.sizeof) < 0) {