From 9236c6f2f9eba2ccac06edc6db09f940da4ce74b Mon Sep 17 00:00:00 2001 From: Ethan Hugg Date: Sun, 7 Oct 2012 22:28:52 -0700 Subject: [PATCH] Bug 798873 - Signaling - increase max SDP size (temporary until better fix). r=jesup,ekr --- media/webrtc/signaling/src/sipcc/core/sdp/sdp.h | 2 +- media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c | 6 ++++-- .../signaling/src/sipcc/core/sipstack/ccsip_sdp.c | 10 +++++----- .../signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h b/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h index 299b981a5931..91c3b62dffb2 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h @@ -53,7 +53,7 @@ #define SDP_CHOOSE_PARAM (-1) #define SDP_SESSION_LEVEL 0xFFFF -#define SDP_MAX_LEN 2048 +#define SDP_MAX_LEN 4096 #define UNKNOWN_CRYPTO_SUITE "UNKNOWN_CRYPTO_SUITE" #define AES_CM_128_HMAC_SHA1_32 "AES_CM_128_HMAC_SHA1_32" diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c index dbdccace68f7..41309826d5dc 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c @@ -208,7 +208,8 @@ sdp_result_e sdp_build_attribute (sdp_t *sdp_p, u16 level, char **ptr, u16 len) result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p, ptr, (u16)(endbuf_p - *ptr)); /* If we ran out of buffer space, though, we must error out */ - MOZ_ASSERT(endbuf_p - *ptr > 0); + /* FIX - re-enable this assert after we check the results from snprintfs in the build_funcs */ + /* MOZ_ASSERT(endbuf_p - *ptr > 0); */ if (endbuf_p - *ptr <= 0) return (SDP_POTENTIAL_SDP_OVERFLOW); @@ -3875,7 +3876,8 @@ sdp_result_e sdp_build_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p, ptr, (u16)(endbuf_p - *ptr)); /* If we ran out of buffer space, though, we must error out */ - MOZ_ASSERT(endbuf_p - *ptr > 0); + /* FIX - re-enable this assert after we check the result from snprintf above */ + /* MOZ_ASSERT(endbuf_p - *ptr > 0); */ if (endbuf_p - *ptr <= 0) return (SDP_POTENTIAL_SDP_OVERFLOW); diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c index 46522a73d7dd..81160a5b64a2 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/ccsip_sdp.c @@ -432,13 +432,13 @@ sipsdp_write_to_buf (cc_sdp_t *sdp_info, uint32_t *retbytes) sdp_get_result_name(rc)); if (rc == SDP_POTENTIAL_SDP_OVERFLOW) { - /* SDP may have been truncated. Issue a warning and continue. */ + /* SDP may have been truncated. Issue an extra warning and abort */ CCSIP_DEBUG_ERROR(SIP_F_PREFIX"Build SDP buffer overflow\n", fname); - } else { - cpr_free(buf); - *retbytes = 0; - return (NULL); } + + cpr_free(buf); + *retbytes = 0; + return (NULL); } /* diff --git a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h index 523b1673cdc5..78a40dbd2104 100644 --- a/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h +++ b/media/webrtc/signaling/src/sipcc/core/sipstack/h/ccsip_sdp.h @@ -47,7 +47,7 @@ #include "ccapi.h" // RAMC-start -#define CCSIP_SDP_BUF_SIZE 2048 +#define CCSIP_SDP_BUF_SIZE SDP_MAX_LEN /* SDP bitmask values */ #define CCSIP_SRC_SDP_BIT 0x1