From 0ba57c0e9bf01b55fa67ee53c0147e3bc0e2c0fa Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Mon, 22 Sep 2003 23:29:44 +0000 Subject: [PATCH] - \0 termination of read SIP telegram from line --- ChangeLog | 4 ++++ RELNOTES | 9 ++++++++- configure.in | 2 +- src/siproxd.c | 11 ++++++++--- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed662a1..cbfc373 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +0.3.7 +===== + 22-Sep-2003: - \0 termination of read SIP telegram from line + 0.3.6 ===== 22-Sep-2003: - released 0.3.6 diff --git a/RELNOTES b/RELNOTES index 87f43a0..e735081 100644 --- a/RELNOTES +++ b/RELNOTES @@ -60,9 +60,16 @@ Known bugs: ----- -md5sum for siproxd-0.3.6.tar.gz: +md5sum for siproxd-0.3.6.tar.gz: 2f17fcb5d13844ee75359dbe12d34e55 GnuPG signature for siproxd-0.3.6.tar.gz archive: +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.2.1 (GNU/Linux) + +iD8DBQA/b109CfzBioe83JQRAuXAAJwMLqgvdVwUCph0941ybGysJwnquwCeMnlK +yH2kTVVq6cIRqG+TtgbY7M4= +=h9bM +-----END PGP SIGNATURE----- GnuPG: pub 1024D/87BCDC94 2000-03-19 Thomas Ries diff --git a/configure.in b/configure.in index 5770b52..5e20528 100644 --- a/configure.in +++ b/configure.in @@ -30,7 +30,7 @@ dnl Release Version dnl SPD_MAJOR_VERSION=0 SPD_MINOR_VERSION=3 -SPD_MICRO_VERSION=6 +SPD_MICRO_VERSION=7 SPD_VERSION=$SPD_MAJOR_VERSION.$SPD_MINOR_VERSION.$SPD_MICRO_VERSION diff --git a/src/siproxd.c b/src/siproxd.c index 06f94e7..f2e724c 100644 --- a/src/siproxd.c +++ b/src/siproxd.c @@ -191,13 +191,14 @@ INFO("daemonizing done (pid=%i)", getpid()); /* got input, process */ DEBUGC(DBCLASS_BABBLE,"back from sip_wait"); - i=sipsock_read(&buff, sizeof(buff), &from); + i=sipsock_read(&buff, sizeof(buff)-1, &from); + buff[i]='\0'; #ifdef MOREDEBUG /*&&&&*/ {char tmp[32]; strncpy(tmp, buff, 30); tmp[30]='\0'; -INFO("got packet from %s [%s]", inet_ntoa(from.sin_addr), tmp);} +INFO("got packet [%i bytes]from %s [%s]", i, inet_ntoa(from.sin_addr), tmp);} #endif /* evaluate the access lists (IP based filter)*/ access=accesslist_check(from); @@ -225,7 +226,11 @@ INFO("got packet from %s [%s]", inet_ntoa(from.sin_addr), tmp);} /* integrity checks - parsed buffer*/ sts=security_check_sip(my_msg); - if (sts != STS_SUCCESS) continue; /* there are no resources to free */ + if (sts != STS_SUCCESS) { + ERROR("security_check_sip() failed... this is not good"); + DUMP_BUFFER(-1, buff, i); + goto end_loop; /* skip and free resources */ + } DEBUGC(DBCLASS_SIP,"received SIP type %s:%s", (MSG_IS_REQUEST(my_msg))? "REQ" : "RES",