FS-7078: fix sip_header_as_string to properly null_terminate on larger header strings
This commit is contained in:
parent
39fa0b9664
commit
19272dc5e2
|
@ -1 +1 @@
|
||||||
Wed Nov 12 13:07:56 CST 2014
|
Fri Dec 12 10:24:52 CST 2014
|
||||||
|
|
|
@ -394,7 +394,7 @@ issize_t sip_header_field_e(char *b, isize_t bsiz, sip_header_t const *h, int fl
|
||||||
char *sip_header_as_string(su_home_t *home, sip_header_t const *h)
|
char *sip_header_as_string(su_home_t *home, sip_header_t const *h)
|
||||||
{
|
{
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
char *rv, s[128];
|
char *rv, s[256];
|
||||||
|
|
||||||
if (h == NULL)
|
if (h == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -412,6 +412,7 @@ char *sip_header_as_string(su_home_t *home, sip_header_t const *h)
|
||||||
for (rv = su_alloc(home, len);
|
for (rv = su_alloc(home, len);
|
||||||
rv;
|
rv;
|
||||||
rv = su_realloc(home, rv, len)) {
|
rv = su_realloc(home, rv, len)) {
|
||||||
|
memset(rv,0,len);
|
||||||
ssize_t n = sip_header_field_e(rv, len, h, 0);
|
ssize_t n = sip_header_field_e(rv, len, h, 0);
|
||||||
if (n > -1 && n + 1 <= len)
|
if (n > -1 && n + 1 <= len)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue