about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-12-18 13:34:05 +0000
committerLaurent Bercot <ska@appnovation.com>2023-12-18 13:34:05 +0000
commitf34b717a6c468d02e8e4741fa96be52f49aa0b12 (patch)
tree54d591d44bb316cd76b2cf7d399ae18a78f46fb3
parent4f3d7b365af04b147f99486a86b89a8ff830b927 (diff)
downloads6-f34b717a6c468d02e8e4741fa96be52f49aa0b12.tar.gz
s6-f34b717a6c468d02e8e4741fa96be52f49aa0b12.tar.xz
s6-f34b717a6c468d02e8e4741fa96be52f49aa0b12.zip
Fix small UB when no selection in s6-log
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--src/daemontools-extras/s6-log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c
index 18a50be..a8ad950 100644
--- 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] ;