Commit 4df0ebb9 authored by Pekka Pessi's avatar Pekka Pessi

sdp_parse.c: allow msgsize = -1 in sdp_parse() arguments

MeeGo Coverity issue CID#7514
parent d672c684
......@@ -107,8 +107,12 @@ static int parsing_error(sdp_parser_t *p, char const *fmt, ...);
/** Parse an SDP message.
*
* The function sdp_parse() parses an SDP message @a msg of size @a
* msgsize. Parsing is done according to the given @a flags. The SDP message
* may not contain a NUL.
* msgsize. If msgsize is -1, the size of message is calculated using
* strlen().
*
* Parsing is done according to the given @a flags.
*
* The SDP message may not contain a NUL.
*
* The parsing result is stored to an #sdp_session_t structure.
*
......@@ -144,7 +148,7 @@ sdp_parse(su_home_t *home, char const msg[], issize_t msgsize, int flags)
char *b;
size_t len;
if (msgsize == -1 || msg == NULL) {
if (msg == NULL) {
p = su_home_clone(home, sizeof(*p));
if (p)
parsing_error(p, "invalid input message");
......@@ -153,7 +157,7 @@ sdp_parse(su_home_t *home, char const msg[], issize_t msgsize, int flags)
return p;
}
if (msgsize == -1 && msg)
if (msgsize == -1)
len = strlen(msg);
else
len = msgsize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment