spencerdodd / kernelpop

kernel privilege escalation enumeration and exploitation framework
687 stars 130 forks source link

[mac os] fix crash when sw_vers doesn't include release version number #17

Closed adnissen closed 7 years ago

adnissen commented 7 years ago

Apple doesn't include the last number for the first version of each os, for instance on 10.13 sw_vers produces:

ProductName:    Mac OS X
ProductVersion: 10.13
BuildVersion:   17A405

This patch safely handles this case.

@spencerdodd

spencerdodd commented 7 years ago

Hey this looks great, thanks for the contribution!