Index: modules/nathelper/nathelper.c
===================================================================
--- modules/nathelper/nathelper.c	(revision 5883)
+++ modules/nathelper/nathelper.c	(working copy)
@@ -2764,7 +2764,9 @@
 					 * a comma-separated list.
 					 */
 					for (cp = payload_types.s;
-					    cp < payload_types.s + payload_types.len; cp++) {
+							(cp < payload_types.s + payload_types.len) &&
+							(cp1 - (char *)v[1].iov_base < sizeof(opts) - 1);
+							cp++) {
 						if (isdigit(*cp)) {
 							*cp1 = *cp;
 							cp1++;
Index: timer.c
===================================================================
--- timer.c	(revision 5883)
+++ timer.c	(working copy)
@@ -16,8 +16,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License 
+ * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * History:
@@ -145,7 +145,7 @@
  * \brief Create a new timer, allocated in private memory
  * \return NULL on error, a pointer to the new timer on success
  */
-static inline struct sr_timer* new_sr_timer(timer_function f,
+static inline struct sr_timer* new_sr_timer(timer_function f, 
 										void* param, unsigned int interval)
 {
 	struct sr_timer* t;
@@ -258,19 +258,16 @@
 /*!
  * \brief Process all timer on the list
  */
-static inline void timer_ticker(struct sr_timer *timer_list, int do_jiffies)
+static inline void timer_ticker(struct sr_timer *timer_list)
 {
 	struct sr_timer* t;
 	unsigned int prev_jiffies;
 
 	prev_jiffies=*jiffies;
 	*jiffies+=TIMER_TICK;
-	if (do_jiffies) {
-		*jiffies+=TIMER_TICK;
-	}
 	/* test for overflow (if tick= 1s =>overflow in 136 years)*/
-	if (*jiffies<prev_jiffies){
-		/*force expire & update every timer, a little buggy but it
+	if (*jiffies<prev_jiffies){ 
+		/*force expire & update every timer, a little buggy but it 
 		 * happens once in 136 years :) */
 		for(t=timer_list;t;t=t->next){
 			t->expires=*jiffies+t->interval;
@@ -278,7 +275,7 @@
 		}
 		return;
 	}
-
+	
 	for (t=timer_list;t; t=t->next){
 		if (*jiffies>=t->expires){
 			t->expires=*jiffies+t->interval;
@@ -291,13 +288,11 @@
 /*!
  * \brief Process all utimer on the list
  */
-static inline void utimer_ticker(struct sr_timer *utimer_list, int do_jiffies)
+static inline void utimer_ticker(struct sr_timer *utimer_list)
 {
 	struct sr_timer* t;
 
-	if (do_jiffies) {
-		*ujiffies+=UTIMER_TICK;
-	}
+	*ujiffies+=UTIMER_TICK;
 	/* no overflow test as even if we go for 1 microsecond tick, this will
 	 * happen in 14038618 years :P */
 
@@ -315,6 +310,8 @@
  */
 static void run_timer_process(struct sr_timer_process *tpl, int do_jiffies)
 {
+	unsigned int local_jiffies=0;
+	utime_t      local_ujiffies=0;
 	unsigned int multiple;
 	unsigned int cnt;
 	struct timeval o_tv;
@@ -333,11 +330,16 @@
 	LM_DBG("tv = %ld, %ld , m=%d\n",
 		o_tv.tv_sec,o_tv.tv_usec,multiple);
 
+	if (!do_jiffies) {
+		jiffies = &local_jiffies;
+		ujiffies = &local_ujiffies;
+	}
+
 	if (tpl->utimer_list==NULL) {
 		for( ; ; ) {
 			tv = o_tv;
 			select( 0, 0, 0, 0, &tv);
-			timer_ticker(tpl->timer_list, do_jiffies);
+			timer_ticker(tpl->timer_list);
 		}
 
 	} else
@@ -345,7 +347,7 @@
 		for( ; ; ) {
 			tv = o_tv;
 			select( 0, 0, 0, 0, &tv);
-			utimer_ticker(tpl->utimer_list, do_jiffies);
+			utimer_ticker(tpl->utimer_list);
 		}
 
 	} else
@@ -353,17 +355,17 @@
 		for( ; ; ) {
 			tv = o_tv;
 			select( 0, 0, 0, 0, &tv);
-			timer_ticker(tpl->timer_list, do_jiffies);
-			utimer_ticker(tpl->utimer_list, do_jiffies);
+			timer_ticker(tpl->timer_list);
+			utimer_ticker(tpl->utimer_list);
 		}
 
 	} else {
 		for( cnt=1 ; ; cnt++ ) {
 			tv = o_tv;
 			select( 0, 0, 0, 0, &tv);
-			utimer_ticker(tpl->utimer_list, do_jiffies);
+			utimer_ticker(tpl->utimer_list);
 			if (cnt==multiple) {
-				timer_ticker(tpl->timer_list, do_jiffies);
+				timer_ticker(tpl->timer_list);
 				cnt = 0;
 			}
 		}
