aboutsummaryrefslogtreecommitdiffstats
path: root/src/ClientNew.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-25 22:08:11 +0100
committerMax Kellermann <max@duempel.org>2013-11-25 22:09:06 +0100
commit2ef6052536b91d9312191ca91de663b73249aea5 (patch)
tree1bd1699d46548564266bdbbe7b50538bb415f865 /src/ClientNew.cxx
parent394b1e635124014cca53edf948c9ce379c7fc160 (diff)
downloadmpd-2ef6052536b91d9312191ca91de663b73249aea5.tar.gz
mpd-2ef6052536b91d9312191ca91de663b73249aea5.tar.xz
mpd-2ef6052536b91d9312191ca91de663b73249aea5.zip
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.
Diffstat (limited to 'src/ClientNew.cxx')
-rw-r--r--src/ClientNew.cxx4
1 files changed, 3 insertions, 1 deletions
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);