Skip to content

Commit dbceae2

Browse files
committed
sdp: fix crash in SDP parsing
Introduced in commit 7743524
1 parent 397e1da commit dbceae2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

parser/sdp/sdp.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,19 @@ void set_sdp_payload_fmtp(sdp_payload_attr_t *payload_attr, str *fmtp_string )
234234
return;
235235
}
236236

237-
int set_sdp_payload_custom_attr(sdp_payload_attr_t *payload_attr, str *attr )
237+
void set_sdp_payload_custom_attr(sdp_payload_attr_t *payload_attr, str *attr )
238238
{
239+
if (payload_attr == NULL) {
240+
LM_DBG("No payload_attr\n");
241+
return;
242+
}
239243
if (payload_attr->custom_attrs_size == MAX_CUSTOM_ATTRS-1) {
240244
LM_DBG("Max custom a= attrs reached \n");
241-
return -1;
245+
return;
242246
}
243247

244248
payload_attr->custom_attrs[payload_attr->custom_attrs_size++] = *attr;
245-
return 1;
249+
return;
246250
}
247251

248252
/*

parser/sdp/sdp_helpr_funcs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int extract_custom_a_attr(str *body, str *payload, str *value)
178178
cp = eat_space_end(value->s, value->s + len);
179179
len -= cp - value->s;
180180
if (len <= 0 || cp == value->s) {
181-
LM_ERR("no value in a= line \n");
181+
LM_DBG("no value in a= line \n");
182182
return -1;
183183
}
184184

0 commit comments

Comments
 (0)