You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
rtmpproto: avoid setting auth var value if null
Use default values if parsed variable is found not to have any value. Avoids crashing at strlen for salt/user on the auth call afterwards and needless NULL assignments for the rest (default is already NULL for those). Should fix Coverity Scan issues #966644 and #966645 Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
This commit is contained in:
@@ -1712,18 +1712,21 @@ static int handle_connect_error(URLContext *s, const char *desc)
|
|||||||
char *value = strchr(ptr, '=');
|
char *value = strchr(ptr, '=');
|
||||||
if (next)
|
if (next)
|
||||||
*next++ = '\0';
|
*next++ = '\0';
|
||||||
if (value)
|
if (value) {
|
||||||
*value++ = '\0';
|
*value++ = '\0';
|
||||||
if (!strcmp(ptr, "user")) {
|
if (!strcmp(ptr, "user")) {
|
||||||
user = value;
|
user = value;
|
||||||
} else if (!strcmp(ptr, "salt")) {
|
} else if (!strcmp(ptr, "salt")) {
|
||||||
salt = value;
|
salt = value;
|
||||||
} else if (!strcmp(ptr, "opaque")) {
|
} else if (!strcmp(ptr, "opaque")) {
|
||||||
opaque = value;
|
opaque = value;
|
||||||
} else if (!strcmp(ptr, "challenge")) {
|
} else if (!strcmp(ptr, "challenge")) {
|
||||||
challenge = value;
|
challenge = value;
|
||||||
} else if (!strcmp(ptr, "nonce")) {
|
} else if (!strcmp(ptr, "nonce")) {
|
||||||
nonce = value;
|
nonce = value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
av_log(s, AV_LOG_WARNING, "Variable %s has NULL value\n", ptr);
|
||||||
}
|
}
|
||||||
ptr = next;
|
ptr = next;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user