[Pkg-voip-commits] r9801 - in /kamailio/trunk/debian/patches: series upstream/0011-modules_k-siptrace-fixed-function-pipport2su.-error-.patch upstream/0012-usrloc-k-safety-check-for-first-record-in-udomain-sl.patch
maniac-guest at alioth.debian.org
maniac-guest at alioth.debian.org
Wed Jun 13 22:03:27 UTC 2012
Author: maniac-guest
Date: Wed Jun 13 22:03:27 2012
New Revision: 9801
URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=9801
Log:
upstream fixes
Added:
kamailio/trunk/debian/patches/upstream/0011-modules_k-siptrace-fixed-function-pipport2su.-error-.patch
kamailio/trunk/debian/patches/upstream/0012-usrloc-k-safety-check-for-first-record-in-udomain-sl.patch
Modified:
kamailio/trunk/debian/patches/series
Modified: kamailio/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/series?rev=9801&op=diff
==============================================================================
--- kamailio/trunk/debian/patches/series (original)
+++ kamailio/trunk/debian/patches/series Wed Jun 13 22:03:27 2012
@@ -8,6 +8,8 @@
upstream/0008-modules_k-auth_radius-fixed-typo-in-README.patch
upstream/0009-rtpproxy-handle-UPDATE-in-rtpproxy_manage.patch
upstream/0010-modules_k-registrar-Fixed-memory-leak-in-reg_fetch_c.patch
+upstream/0011-modules_k-siptrace-fixed-function-pipport2su.-error-.patch
+upstream/0012-usrloc-k-safety-check-for-first-record-in-udomain-sl.patch
upstream/lua.patch
multiarch_support.patch
no_INSTALL_file.patch
Added: kamailio/trunk/debian/patches/upstream/0011-modules_k-siptrace-fixed-function-pipport2su.-error-.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0011-modules_k-siptrace-fixed-function-pipport2su.-error-.patch?rev=9801&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0011-modules_k-siptrace-fixed-function-pipport2su.-error-.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0011-modules_k-siptrace-fixed-function-pipport2su.-error-.patch Wed Jun 13 22:03:27 2012
@@ -1,0 +1,114 @@
+From 06d1739e187cbdc4903645b99e2702e864f7cbc6 Mon Sep 17 00:00:00 2001
+From: Alexandr Dubovikov <alexandr.dubovikov at gmail.com>
+Date: Fri, 3 Feb 2012 16:12:38 +0100
+Subject: [PATCH] modules_k:siptrace fixed function pipport2su. (error if url
+ doesn't have port) Thanks David Kovarik for report.
+ (cherry picked from commit
+ 830544e5b349bf808fb0f1ac12cf08610181c64d)
+
+---
+ modules_k/siptrace/siptrace.c | 54 +++++++++++++++++++++++------------------
+ 1 file changed, 31 insertions(+), 23 deletions(-)
+
+diff --git a/modules_k/siptrace/siptrace.c b/modules_k/siptrace/siptrace.c
+index a912fb4..ccdf555 100644
+--- a/modules_k/siptrace/siptrace.c
++++ b/modules_k/siptrace/siptrace.c
+@@ -1621,6 +1621,7 @@ static int pipport2su (char *pipport, union sockaddr_union *tmp_su, unsigned int
+ char *p, *host_s;
+ str port_str, host_uri;
+ unsigned len = 0;
++ char tmp_piport[256];
+
+ /*parse protocol */
+ if(strncmp(pipport, "udp:",4) == 0) *proto = IPPROTO_UDP;
+@@ -1634,42 +1635,49 @@ static int pipport2su (char *pipport, union sockaddr_union *tmp_su, unsigned int
+ LM_ERR("bad protocol %s\n", pipport);
+ return -1;
+ }
++
++ if((len = strlen(pipport)) > 256) {
++ LM_ERR("too big pipport\n");
++ goto error;
++ }
++
++ /* our tmp string */
++ strncpy(tmp_piport, pipport, len);
++
++ len = 0;
+
+ /*separate proto and host */
+- p = pipport+cutlen;
++ p = tmp_piport+cutlen;
+ if( (*(p)) == '\0') {
+ LM_ERR("malformed ip address\n");
+- return -1;
++ goto error;
+ }
+ host_s=p;
+
+ if( (p = strrchr(p+1, ':')) == 0 ) {
+- LM_ERR("no port specified\n");
+- return -1;
+- }
+- /*the address contains a port number*/
+- *p = '\0';
+- p++;
+- port_str.s = p;
+- port_str.len = strlen(p);
+- LM_DBG("the port string is %s\n", p);
+- if(str2int(&port_str, &port_no) != 0 ) {
+- LM_ERR("there is not a valid number port\n");
+- return -1;
++ LM_DBG("no port specified\n");
++ port_no = 0;
+ }
+- *p = '\0';
+- if (port_no<1024 || port_no>65536)
+- {
+- LM_ERR("invalid port number; must be in [1024,65536]\n");
+- return -1;
+- }
+-
++ else {
++ /*the address contains a port number*/
++ *p = '\0';
++ p++;
++ port_str.s = p;
++ port_str.len = strlen(p);
++ LM_DBG("the port string is %s\n", p);
++ if(str2int(&port_str, &port_no) != 0 ) {
++ LM_ERR("there is not a valid number port\n");
++ goto error;
++ }
++ *p = '\0';
++ }
++
+ /* now IPv6 address has no brakets. It should be fixed! */
+ if (host_s[0] == '[') {
+ len = strlen(host_s + 1) - 1;
+ if(host_s[len+1] != ']') {
+ LM_ERR("bracket not closed\n");
+- return -1;
++ goto error;
+ }
+ memmove(host_s, host_s + 1, len);
+ host_s[len] = '\0';
+@@ -1678,7 +1686,6 @@ static int pipport2su (char *pipport, union sockaddr_union *tmp_su, unsigned int
+ host_uri.s = host_s;
+ host_uri.len = strlen(host_s);
+
+-
+ /* check if it's an ip address */
+ if (((ip=str2ip(&host_uri))!=0)
+ #ifdef USE_IPV6
+@@ -1690,5 +1697,6 @@ static int pipport2su (char *pipport, union sockaddr_union *tmp_su, unsigned int
+
+ }
+
++error:
+ return -1;
+ }
+--
+1.7.9.5
+
Added: kamailio/trunk/debian/patches/upstream/0012-usrloc-k-safety-check-for-first-record-in-udomain-sl.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0012-usrloc-k-safety-check-for-first-record-in-udomain-sl.patch?rev=9801&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0012-usrloc-k-safety-check-for-first-record-in-udomain-sl.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0012-usrloc-k-safety-check-for-first-record-in-udomain-sl.patch Wed Jun 13 22:03:27 2012
@@ -1,0 +1,42 @@
+From cc952f8469dea60b9e7f0e70063046f086a2866f Mon Sep 17 00:00:00 2001
+From: Daniel-Constantin Mierla <miconda at gmail.com>
+Date: Wed, 13 Jun 2012 16:33:17 +0200
+Subject: [PATCH] usrloc(k): safety check for first record in udomain slot
+
+- reported by David Kovarik, FS#234
+(cherry picked from commit 31f404a98b09b5a6270e860574b16c9f9112c305)
+---
+ modules_k/usrloc/udomain.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/modules_k/usrloc/udomain.c b/modules_k/usrloc/udomain.c
+index cd41bd2..ab753bb 100644
+--- a/modules_k/usrloc/udomain.c
++++ b/modules_k/usrloc/udomain.c
+@@ -856,14 +856,16 @@ int get_urecord(udomain_t* _d, str* _aor, struct urecord** _r)
+ sl = aorhash&(_d->size-1);
+ r = _d->table[sl].first;
+
+- for(i = 0; i < _d->table[sl].n; i++) {
+- if((r->aorhash==aorhash) && (r->aor.len==_aor->len)
+- && !memcmp(r->aor.s,_aor->s,_aor->len)){
+- *_r = r;
+- return 0;
+- }
++ if(r!=NULL) {
++ for(i = 0; i < _d->table[sl].n; i++) {
++ if((r->aorhash==aorhash) && (r->aor.len==_aor->len)
++ && !memcmp(r->aor.s,_aor->s,_aor->len)){
++ *_r = r;
++ return 0;
++ }
+
+- r = r->next;
++ r = r->next;
++ }
+ }
+ } else {
+ /* search in DB */
+--
+1.7.9.5
+
More information about the Pkg-voip-commits
mailing list