Projects
Browse Source     Search     Timeline     Wiki

Changeset 23273

Show
Ignore:
Timestamp:
06/06/07 09:04:51 (18 months ago)
Author:
zarzycki@…
Message:

<rdar://problem/5253449> launchctl:do_sysversion_sysctl() does not have any safety checks

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchctl.c

    r23257 r23273  
    28882888        } 
    28892889 
    2890         versdict = _CFCopySystemVersionDictionary(); 
    2891         buildvers = CFDictionaryGetValue(versdict, _kCFSystemVersionBuildVersionKey); 
    2892         CFStringGetCString(buildvers, buf, sizeof(buf), kCFStringEncodingUTF8); 
    2893  
    2894         if (sysctl(mib, 2, NULL, 0, buf, strlen(buf) + 1) == -1) { 
    2895                 fprintf(stderr, "sysctl(): %s\n", strerror(errno)); 
     2890        if (!assumes((versdict = _CFCopySystemVersionDictionary()))) { 
     2891                return; 
     2892        } 
     2893 
     2894        if (assumes((buildvers = CFDictionaryGetValue(versdict, _kCFSystemVersionBuildVersionKey)))) { 
     2895                CFStringGetCString(buildvers, buf, sizeof(buf), kCFStringEncodingUTF8); 
     2896 
     2897                assumes(sysctl(mib, 2, NULL, 0, buf, strlen(buf) + 1) != -1); 
    28962898        } 
    28972899