Skip to content

Commit a480726

Browse files
committed
1 parent fd9c4f1 commit a480726

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

dmidecode.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5729,13 +5729,14 @@ static u8 *dmi_table_get(off_t base, u32 *len, u16 num, u32 ver,
57295729
if (NULL != dataRef)
57305730
CFRelease(dataRef);
57315731

5732-
// This CFRelease throws 'Segmentation fault: 11' on OS X 10.12, except
5733-
// when run as the child of a signed binary, like lldb.
5734-
//
5735-
// See: https://github.com/cavaliercoder/dmidecode-osx/issues/3
5736-
//
5737-
//if (NULL != properties)
5738-
// CFRelease(properties);
5732+
/*
5733+
* This CFRelease throws 'Segmentation fault: 11' since macOS 10.12, if
5734+
* the compiled binary is not signed with an Apple developer profile.
5735+
*/
5736+
#ifdef SIGNED_BINARY // So don't do that unless you signed it
5737+
if (NULL != properties)
5738+
CFRelease(properties);
5739+
#endif
57395740

57405741
IOObjectRelease(service);
57415742
#else
@@ -6161,7 +6162,7 @@ int main(int argc, char * const argv[])
61616162
goto exit_free;
61626163
}
61636164

6164-
CFDataGetBytes(dataRef, CFRangeMake(0, 0x20), (UInt8*)buf);
6165+
CFDataGetBytes(dataRef, CFRangeMake(0, CFDataGetLength(dataRef)), (UInt8*)buf);
61656166

61666167
if (NULL != dataRef)
61676168
CFRelease(dataRef);

0 commit comments

Comments
 (0)