16 lines
489 B
Diff
16 lines
489 B
Diff
|
Ensure optarg is incremented strictly before it is read from.
|
||
|
https://skarnet.org/lists/supervision/2971.html
|
||
|
|
||
|
--- runit-2.1.2/src/chpst.c.orig
|
||
|
+++ runit-2.1.2/src/chpst.c
|
||
|
@@ -308,7 +308,8 @@
|
||
|
case 'n':
|
||
|
switch (*optarg) {
|
||
|
case '-':
|
||
|
- if (optarg[scan_ulong(++optarg, &ul)]) usage(); nicelvl =ul;
|
||
|
+ ++optarg;
|
||
|
+ if (optarg[scan_ulong(optarg, &ul)]) usage(); nicelvl =ul;
|
||
|
nicelvl *=-1;
|
||
|
break;
|
||
|
case '+': ++optarg;
|