Skip to content

Commit

Permalink
Merge pull request Codeux-Software#313 from balr0g/master
Browse files Browse the repository at this point in the history
Fix /sysinfo truncation
  • Loading branch information
Michael Morris committed Aug 9, 2012
2 parents b0720e9 + 2d9970e commit c160392
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Resources/Plugins/System Profiler/TPI_SP_SysInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,9 @@ + (NSString *)graphicsCardInfo
const void *model = CFDictionaryGetValue(serviceDictionary, @"model");

if (PointerIsNotEmpty(model)) {
if (CFGetTypeID(model) == CFDataGetTypeID()) {
NSString *s = [NSString stringWithData:(__bridge NSData *)model encoding:NSASCIIStringEncoding];
if (CFGetTypeID(model) == CFDataGetTypeID() && CFDataGetLength(model) > 1) {
NSString *s = [NSString stringWithBytes:[(__bridge NSData *)model bytes] length:(CFDataGetLength(model)-1)
encoding:NSASCIIStringEncoding];

[gpuList addObject:s];
}
Expand Down

0 comments on commit c160392

Please sign in to comment.