avformat/icecast: reject CR/LF in metadata header values
Reported by Franciszek Kalinowski (isec.pl / striga.ai) and Bartosz Smigielski.
(cherry picked from commit 99e1ecca36)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
269201a990
commit
cb112ece1c
@@ -70,8 +70,14 @@ static const AVOption options[] = {
|
||||
|
||||
static void cat_header(AVBPrint *bp, const char key[], const char value[])
|
||||
{
|
||||
if (NOT_EMPTY(value))
|
||||
if (NOT_EMPTY(value)) {
|
||||
if (strpbrk(value, "\r\n")) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Refusing to send '%s' header: value contains CR/LF\n", key);
|
||||
return;
|
||||
}
|
||||
av_bprintf(bp, "%s: %s\r\n", key, value);
|
||||
}
|
||||
}
|
||||
|
||||
static int icecast_close(URLContext *h)
|
||||
|
||||
Reference in New Issue
Block a user