On 2012-03-12 18:16, ECKSCHLAGER Manfred wrote:

Hi,

I'd like to suggestseveral patches for the current version of Sofia sip (1.12.11):

First an index out of bounds in check_sres_sip.c, in line 113 and 114 it accessessu_addrinfo_t hint_udp_tcp_tls[2]

Index: libsofia-sip-ua/sresolv/check_sres_sip.c

================================================================

--- libsofia-sip-ua/sresolv/check_sres_sip.c

+++ libsofia-sip-ua/sresolv/check_sres_sip.c    (working copy)

@@ -66,7 +66,7 @@

 } x[1];

 static su_addrinfo_t hint_udp_tcp[2];

-static su_addrinfo_t hint_udp_tcp_tls[2];

+static su_addrinfo_t hint_udp_tcp_tls[3];

 static su_addrinfo_t hint_udp_tcp_ip4[2];

 static su_addrinfo_t hint_tls[1];

 static su_addrinfo_t hint_tls_udp_tcp[1];

Here I changed it to what it says in den method description to return NUL, because the original might return something else.

Index: libsofia-sip-ua/http/http_basic.c

--- libsofia-sip-ua/http/http_basic.c

+++ libsofia-sip-ua/http/http_basic.c   (working copy)

@@ -587,9 +587,9 @@

     if (date == 0)

       date = msg_now();

     h->sh_date->d_time = date;

+    return h->sh_date;

   }

-

-  return h->sh_date;

+  return NULL;

 }

And finally this should remove a resource leak in the hffile pointer.

Index: utils/sip-options.c

================================================================

--- utils/sip-options.c

+++ utils/sip-options.c (working copy)

@@ -279,15 +279,18 @@

       context->c_password = from->a_url->url_password;

       from->a_url->url_password = NULL;

-      if (extra) {

-       FILE *hf;

+    if (extra) {

+               FILE *hf;

-       if (strcmp(extra, "-"))

-         hf = fopen(extra, "rb");

-       else

-         hf = stdin;

-

-       extra = readfile(hf);

+               if (strcmp(extra, "-")) {

+                       hf = fopen(extra, "rb");

+                       extra = readfile(hf);

+                       fclose(hf);

+               }

+               else {

+                       hf = stdin;

+                       extra = readfile(hf);

+               }

       }

       context->c_proxy = url_hdup(context->c_home,

Hope these patchesgetaccepted,I might still have a couple of suggested fixes, should I keep on sending them to this newsgroup?

Best regards,

  Manfred



------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2


_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Hi!

Thanks for the patches!

I don't know what is the best way to submit patches, but you can use the tracker on sourceforge: http://sourceforge.net/tracker/?group_id=143636&atid=756078 <http://sourceforge.net/tracker/?group_id=143636&atid=756078>
(you have to register before submitting a patch)

Benoît

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to