diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-04-26 11:33:11 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-04-26 11:33:11 +0200 |
commit | 4cf897c200e72ba5d8823af3fcd515ac92651b99 (patch) | |
tree | 01c9a9bd7b4ff3964a84cec119054a6692397a53 /lib.c | |
parent | 35af4ba4fc21a4b2357c50e6b02a2e3e4b236e88 (diff) |
lib: uc_system(): fix invalid free() of non-heap memory
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2127,9 +2127,9 @@ uc_system(uc_vm *vm, size_t nargs) switch (ucv_type(cmdline)) { case UC_STRING: arglist = xalloc(sizeof(*arglist) * 4); - arglist[0] = "/bin/sh"; - arglist[1] = "-c"; - arglist[2] = ucv_string_get(cmdline); + arglist[0] = xstrdup("/bin/sh"); + arglist[1] = xstrdup("-c"); + arglist[2] = ucv_to_string(vm, cmdline); arglist[3] = NULL; break; |