From 2ef6052536b91d9312191ca91de663b73249aea5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 25 Nov 2013 22:08:11 +0100 Subject: [PATCH] ClientNew: fix nullptr dereference after g_get_prgname() failure Hard-code the program name to "mpd" instead of using g_get_prgname(). The latter has become useless since this GLib variable doesn't get initialized anymore. --- src/ClientNew.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ClientNew.cxx b/src/ClientNew.cxx index e84887072..c6df5a883 100644 --- a/src/ClientNew.cxx +++ b/src/ClientNew.cxx @@ -73,7 +73,9 @@ client_new(EventLoop &loop, Partition &partition, if (sa->sa_family != AF_UNIX) { char *hostaddr = sockaddr_to_string(sa, sa_length, IgnoreError()); - const char *progname = g_get_prgname(); + + // TODO: shall we obtain the program name from argv[0]? + const char *progname = "mpd"; struct request_info req; request_init(&req, RQ_FILE, fd, RQ_DAEMON, progname, 0);