config: oopsie, need to use strndup() on the pipe command

Since it isn't NULL-terminated.
This commit is contained in:
Daniel Eklöf 2020-07-15 17:48:02 +02:00
parent 65a46be822
commit 94bb313282
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -592,7 +592,7 @@ parse_section_key_bindings(
struct config_key_binding_normal binding = {
.action = action,
.key = strdup(value),
.pipe_cmd = pipe_cmd != NULL ? strdup(pipe_cmd) : NULL,
.pipe_cmd = pipe_cmd != NULL ? strndup(pipe_cmd, pipe_len) : NULL,
};
tll_push_back(conf->bindings.key, binding);
}