diff options
Diffstat (limited to 'channels/pjsip')
-rw-r--r-- | channels/pjsip/dialplan_functions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c index 8080f86a4..e291110e2 100644 --- a/channels/pjsip/dialplan_functions.c +++ b/channels/pjsip/dialplan_functions.c @@ -866,11 +866,11 @@ static int media_offer_read_av(struct ast_sip_session *session, char *buf, /* add one since we'll include a comma */ size = strlen(ast_format_get_name(fmt)) + 1; - len -= size; - if ((len) < 0) { + if (len < size) { ao2_ref(fmt, -1); break; } + len -= size; /* no reason to use strncat here since we have already ensured buf has enough space, so strcat can be safely used */ |