diff options
author | Max Kellermann <max@duempel.org> | 2013-11-25 22:08:11 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-11-25 22:09:06 +0100 |
commit | 2ef6052536b91d9312191ca91de663b73249aea5 (patch) | |
tree | 1bd1699d46548564266bdbbe7b50538bb415f865 /src | |
parent | 394b1e635124014cca53edf948c9ce379c7fc160 (diff) | |
download | mpd-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')
-rw-r--r-- | src/ClientNew.cxx | 4 |
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); |