diff options
author | vkalintiris <vasilis@netdata.cloud> | 2022-11-29 17:26:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-29 17:26:35 +0200 |
commit | 4de2ce54d59a4128425f8dde5924eed4fc6dad97 (patch) | |
tree | 698f01c9f404468887d4ae4ff797c3cef8c7ce21 /spawn/spawn.c | |
parent | 462988dac901e95e765cd6be2dc24a5c33595526 (diff) |
Sanitize command arguments. (#14064)
* Sanitize bash arguments.
Remove leading dashes and escape single quotes in command arguments.
* Quote expanded variable in test
Diffstat (limited to 'spawn/spawn.c')
-rw-r--r-- | spawn/spawn.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spawn/spawn.c b/spawn/spawn.c index 051955e884..f326f88815 100644 --- a/spawn/spawn.c +++ b/spawn/spawn.c @@ -8,7 +8,7 @@ int spawn_thread_shutdown; struct spawn_queue spawn_cmd_queue; -static struct spawn_cmd_info *create_spawn_cmd(char *command_to_run) +static struct spawn_cmd_info *create_spawn_cmd(const char *command_to_run) { struct spawn_cmd_info *cmdinfo; @@ -57,7 +57,7 @@ static void init_spawn_cmd_queue(void) /* * Returns serial number of the enqueued command */ -uint64_t spawn_enq_cmd(char *command_to_run) +uint64_t spawn_enq_cmd(const char *command_to_run) { unsigned queue_size; uint64_t serial; |