runit: fix -n parsing in chpst.
This commit is contained in:
parent
b8a0c40c38
commit
fba58d92a5
14
srcpkgs/runit/patches/chpst.patch
Normal file
14
srcpkgs/runit/patches/chpst.patch
Normal file
@ -0,0 +1,14 @@
|
||||
Fix UB which breaks -n with negative 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;
|
@ -1,7 +1,7 @@
|
||||
# Template file for 'runit'
|
||||
pkgname=runit
|
||||
version=2.1.2
|
||||
revision=12
|
||||
revision=13
|
||||
build_wrksrc="${pkgname}-${version}/src"
|
||||
build_style="gnu-makefile"
|
||||
short_desc="UNIX init scheme with service supervision"
|
||||
|
Loading…
Reference in New Issue
Block a user