From d69e2939dfa7b9c4eb1994fa8b7c6ea4ee0da654 Mon Sep 17 00:00:00 2001 From: mstone2001 <80594939+mstone2001@users.noreply.github.com> Date: Sun, 24 Sep 2023 19:16:59 -0400 Subject: [PATCH] Fix core on Ventura due to hardcoded size. --- dmidecode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dmidecode.c b/dmidecode.c index bb651da..194108c 100644 --- a/dmidecode.c +++ b/dmidecode.c @@ -4811,8 +4811,10 @@ static void dmi_table(off_t base, u32 len, u16 num, u32 ver, const char *devmem, * This CFRelease throws 'Segmentation fault: 11' since macOS 10.12, if * the compiled binary is not signed with an Apple developer profile. */ + #ifdef SIGNED_BINARY // So don't do that unless you signed it if (NULL != properties) CFRelease(properties); + #endif IOObjectRelease(service); } @@ -5147,7 +5149,7 @@ int main(int argc, char * const argv[]) goto exit_free; } - CFDataGetBytes(dataRef, CFRangeMake(0, 0x20), (UInt8*)buf); + CFDataGetBytes(dataRef, CFRangeMake(0, CFDataGetLength(dataRef)), (UInt8*)buf); if (NULL != dataRef) CFRelease(dataRef);