Skip to content
Snippets Groups Projects
Commit 4053321b authored by Marvin Scholz's avatar Marvin Scholz Committed by Philipp Schafft
Browse files

Fix that global listener count could be negative under certain circumstances

This fixes a bug that could cause the global listener count of Icecast to
be negative. This was caused due to wrong handling of errors in the
format_prepare_headers function.

Fixes: #2199

Thanks a lot to Simeon Völkel (0xBD4E031CDB4043C9) for reporting
and investigating the bug.
parent 72f0c835
No related branches found
No related tags found
No related merge requests found
......@@ -405,8 +405,12 @@ static int format_prepare_headers (source_t *source, client_t *client)
client->refbuf->len -= remaining;
if (source->format->create_client_data)
if (source->format->create_client_data (source, client) < 0)
if (source->format->create_client_data (source, client) < 0) {
ICECAST_LOG_ERROR("Client format header generation failed. "
"(Likely not enough or wrong source data) Dropping client.");
client->respcode = 500;
return -1;
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment