lib/debug: retain full string in state.prog_name global
authorDavid Disseldorp <ddiss@samba.org>
Wed, 6 Feb 2019 11:39:03 +0000 (12:39 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Thu, 7 Feb 2019 16:23:18 +0000 (17:23 +0100)
commitc824240cd48aea9e0655287c98c8de7c3ffd5f94
tree874832359de0f2e2f5fc7a30de387ea41da9fcbd
parent61670169d5241f742bc80bec37b02800af8c8517
lib/debug: retain full string in state.prog_name global

setup_logging() retains a global pointer to the provided const string in
state.prog_name, which is later used in the debug_backend->reload()
callback.
Some setup_logging() callers, such as popt_common_callback(),
incorrectly assume that a dynamic buffer is safe to provide as a
prog_name parameter. Fix this by copying the entire string in
setup_logging().

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/util/debug.c