Merge pull request #18506 from keszybz/fuzz-systemctl-parse-argv

Fuzzer for systemctl argline parsing
This commit is contained in:
Yu Watanabe
2021-02-11 00:29:22 +09:00
committed by GitHub
10 changed files with 96 additions and 23 deletions
+3 -11
View File
@@ -38,18 +38,10 @@ int utmp_get_runlevel(int *runlevel, int *previous) {
* very new and not apply to the current script being executed. */
e = getenv("RUNLEVEL");
if (e && e[0] > 0) {
if (!isempty(e)) {
*runlevel = e[0];
if (previous) {
/* $PREVLEVEL seems to be an Upstart thing */
e = getenv("PREVLEVEL");
if (e && e[0] > 0)
*previous = e[0];
else
*previous = 0;
}
if (previous)
*previous = 0;
return 0;
}