commit f34b717a6c468d02e8e4741fa96be52f49aa0b12
parent 4f3d7b365af04b147f99486a86b89a8ff830b927
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Mon, 18 Dec 2023 13:34:05 +0000
Fix small UB when no selection in s6-log
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c
@@ -1232,7 +1232,7 @@ int main (int argc, char const *const *argv)
mask = ~mask & 0666 ;
script_firstpass(argv, &sellen, &actlen, &scriptlen, &gflags) ;
{
- sel_t selections[sellen] ;
+ sel_t selections[sellen ? sellen : 1] ;
act_t actions[actlen] ;
scriptelem_t script[scriptlen] ;
logdir_t logdirblob[llen] ;