I noticed chpst -n didn't work and found this fix.  I just patched it
in Void, other distros may want to apply this too.

Fix UB which breaks -n with negative nice values.
Ensure optarg is incremented strictly before it is read from.

--- runit-2.1.2/src/chpst.c.orig
+++ runit-2.1.2/src/chpst.c
@@ -308,7 +308,7 @@
     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;

-- 
Leah Neukirchen  <l...@vuxu.org>  https://leahneukirchen.org/

Reply via email to