[OpenSIPS-Devel] [opensips] presence_dialoginfo: Fix bounds checking by using a helper function. (#177)
Walter Doekes
notifications at github.com
Wed Mar 12 10:31:24 CET 2014
> return NULL;
> - }
> - memcpy(buf, "sip:", 4);
> - memcpy(buf+4, pres_user->s, pres_user->len);
> - buf[pres_user->len+4] = '@';
> - memcpy(buf + pres_user->len + 5, pres_domain->s, pres_domain->len);
> - buf[pres_user->len + 5 + pres_domain->len]= '\0';
> -
> - pres_uri = (str*)pkg_malloc(sizeof(str));
> - if(pres_uri == NULL)
> - {
> - LM_ERR("while allocating memory\n");
> - return NULL;
> - }
> - memset(pres_uri, 0, sizeof(str));
Memset just before setting it.
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/177/files#r10510194
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20140312/3f70b8e7/attachment.htm>
More information about the Devel
mailing list