sqc 0.4.13

Software Code Quality - CERT C compliance checker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * Rule: WIN02-C
 * Source: testcases
 * Status: FAIL - Should trigger WIN02-C violation
 *
 * Using CreateProcess() without restricted token
 */

#include <windows.h>

void launch_process(void) {
    STARTUPINFO si = {0};
    PROCESS_INFORMATION pi = {0};
    si.cb = sizeof(si);
    /* VIOLATION: CreateProcess without restricted user token */
    CreateProcess(NULL, "child.exe", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}