1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-16 06:15:24 +00:00

Fix: Do not crash URL Auth is used with stream_auth and no credentials are given

This fixes a crash (NULL reference) in case URL Auth is used
and stream_auth is trigged with no credentials passed by the client.
Username and password is now set to empty strings and transmited to
the backend server this way.

See #2191 for more details and to keep track of the problem.

Closes: #2191, DEB#782120
This commit is contained in:
Philipp Schafft 2015-04-08 09:09:26 +00:00
parent 3baa4e46aa
commit 27abfbbd68

View File

@ -539,10 +539,20 @@ static void url_stream_auth (auth_client *auth_user)
host = util_url_escape (config->hostname);
port = config->port;
config_release_config ();
user = util_url_escape (client->username);
pass = util_url_escape (client->password);
ipaddr = util_url_escape (client->con->ip);
if (client->username) {
user = util_url_escape(client->username);
} else {
user = strdup("");
}
if (client->password) {
pass = util_url_escape(client->password);
} else {
pass = strdup("");
}
snprintf (post, sizeof (post),
"action=stream_auth&mount=%s&ip=%s&server=%s&port=%d&user=%s&pass=%s%s",
mount, ipaddr, host, port, user, pass, admin);