mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
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.
This commit is contained in:
parent
c35760cd50
commit
16dac2505e
@ -408,8 +408,12 @@ static int format_prepare_headers (source_t *source, client_t *client)
|
|||||||
|
|
||||||
client->refbuf->len -= remaining;
|
client->refbuf->len -= remaining;
|
||||||
if (source->format->create_client_data)
|
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 -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user