bugsnag/bugsnag-cocoa — pull request #11 by CFKevinRef (2014-02-28 19:44:50+00:00)
Title: machine property: avoid hardcoded sizes/strings in sysctl, check err codes

Replaced the call to sysctlbyname with sysctl, avoiding string parsing.
- used two calls in order to get actual string length
- checked all calls to sysctl, return nil on error
- checked call to malloc, return nil on error

Our lovely security analysis tool flagged this as a must-fix failure to check error conditions on the malloc. I've included an implementation with that and a few other enhancements.