You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running on macOS Ventura I get the following assertion failure:
dmidecode 3.1
Getting SMBIOS data from Apple SMBIOS service.
Assertion failed: (range.location + range.length <= dataLength), function __CFDataValidateRange, file CFData.c, line 235.
zsh: abort dmidecode
Tracing this back the root cause was the CFDataRef was 31 bytes instead of 32. Viewing the apple documentation the correct fix is it should use the CFDataGetLength call to get the actual size rather than hardcoding it. I also had to add an ifdef to remove the Problematic CFRelease(properties) as per the comments. I believe this should be a compile option for the Makefile, as I don't need a signed binary. Here is a diff of my version:
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);
The text was updated successfully, but these errors were encountered:
@igavrysh You are welcome. I have forked this repo myself and submitted a pull request, but I have not heard anything, so I wanted to at least share my fix.
When running on macOS Ventura I get the following assertion failure:
dmidecode 3.1
Getting SMBIOS data from Apple SMBIOS service.
Assertion failed: (range.location + range.length <= dataLength), function __CFDataValidateRange, file CFData.c, line 235.
zsh: abort dmidecode
Tracing this back the root cause was the CFDataRef was 31 bytes instead of 32. Viewing the apple documentation the correct fix is it should use the CFDataGetLength call to get the actual size rather than hardcoding it. I also had to add an ifdef to remove the Problematic CFRelease(properties) as per the comments. I believe this should be a compile option for the Makefile, as I don't need a signed binary. Here is a diff of my version:
The text was updated successfully, but these errors were encountered: