Skip to content

Commit

Permalink
Support larger values for SDP attributes (#3282)
Browse files Browse the repository at this point in the history
  • Loading branch information
petarminchev authored Nov 20, 2023
1 parent c751524 commit d2b829b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/sdp-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ janus_sdp_attribute *janus_sdp_attribute_create(const char *name, const char *va
a->direction = JANUS_SDP_DEFAULT;
a->value = NULL;
if(value) {
char buffer[512];
char buffer[2048];
va_list ap;
va_start(ap, value);
g_vsnprintf(buffer, sizeof(buffer), value, ap);
Expand Down Expand Up @@ -1119,9 +1119,9 @@ char *janus_sdp_write(janus_sdp *imported) {
if(!imported)
return NULL;
janus_refcount_increase(&imported->ref);
char *sdp = g_malloc(1024), mline[8192], buffer[512];
char *sdp = g_malloc(2560), mline[8192], buffer[2048];
*sdp = '\0';
size_t sdplen = 1024, mlen = sizeof(mline), offset = 0, moffset = 0;
size_t sdplen = 2560, mlen = sizeof(mline), offset = 0, moffset = 0;
/* v= */
g_snprintf(buffer, sizeof(buffer), "v=%d\r\n", imported->version);
janus_strlcat_fast(sdp, buffer, sdplen, &offset);
Expand Down
2 changes: 1 addition & 1 deletion src/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ char *janus_sdp_merge(void *ice_handle, janus_sdp *anon, gboolean offer) {
g_free(anon->c_addr);
anon->c_addr = NULL;
/* bundle: add new global attribute */
char buffer[8192], buffer_part[512];
char buffer[8192], buffer_part[2048];
buffer[0] = '\0';
buffer_part[0] = '\0';
g_snprintf(buffer, sizeof(buffer), "BUNDLE");
Expand Down

0 comments on commit d2b829b

Please sign in to comment.