instance: ujail: Fix allocated size for no_new_privs parameter
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 1 Nov 2019 16:16:38 +0000 (17:16 +0100)
committerJohn Crispin <john@phrozen.org>
Sat, 2 Nov 2019 18:30:54 +0000 (19:30 +0100)
commit564ecdfd9cc40e3dd566bf8fd24a94053b99c332
treeffe6c848dde27f9cbe9c13830a286ab86fdaaa8c
parent7fb2e1dfa2214a9b35fa955e98a386e2f3ccb730
instance: ujail: Fix allocated size for no_new_privs parameter

When the no_new_privs parameter is given, thei size of the  array which
contains the argv pointers is not increased in instance_jail_parse()
which causes a buffer overflow. Fix this by requesting one more entry in
instance_jail_parse() for the allocation.

Fixes: dfd5816bcbef ("instance, ujail: wire no_new_privs (-c) option")
Cc: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
service/instance.c