From 527bc5af18b7eefab2aac8f27a1c8be71c379b0f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 30 Aug 2013 15:43:30 +0200 Subject: [PATCH] iptraf-ng: Fix FPE. http://lists.ipfire.org/pipermail/development/2013-August/000420.html https://bugzilla.ipfire.org/show_bug.cgi?id=10408 --- lfs/iptraf-ng | 3 ++- .../iptraf-ng-1.1.4-tcplog_flowrate_msg.patch | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/patches/iptraf-ng-1.1.4-tcplog_flowrate_msg.patch diff --git a/lfs/iptraf-ng b/lfs/iptraf-ng index d0491730fb..e962b2c5e7 100644 --- a/lfs/iptraf-ng +++ b/lfs/iptraf-ng @@ -17,7 +17,7 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = iptraf-ng -PAK_VER = 1 +PAK_VER = 2 DEPS = "" @@ -63,6 +63,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xzf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/iptraf-ng-1.1.4-tcplog_flowrate_msg.patch cd $(DIR_APP) && ./configure \ --prefix=/usr diff --git a/src/patches/iptraf-ng-1.1.4-tcplog_flowrate_msg.patch b/src/patches/iptraf-ng-1.1.4-tcplog_flowrate_msg.patch new file mode 100644 index 0000000000..24a6ce43c6 --- /dev/null +++ b/src/patches/iptraf-ng-1.1.4-tcplog_flowrate_msg.patch @@ -0,0 +1,12 @@ +diff -Nur iptraf-ng-1.1.4-orig/src/tcptable.c iptraf-ng-1.1.4/src/tcptable.c +--- iptraf-ng-1.1.4-orig/src/tcptable.c 2013-07-23 15:06:11.000000000 +0200 ++++ iptraf-ng-1.1.4/src/tcptable.c 2013-08-28 19:10:33.000000000 +0200 +@@ -444,6 +444,8 @@ + size_t bufsize) + { + time_t interval = time(NULL) - entry->conn_starttime; ++ if (interval < 1) ++ interval = 1; + + char rbuf[64]; + rate_print(entry->bcount / interval, rbuf, sizeof(rbuf)); -- 2.39.5