From e6825a1985abe2f4a5ef179265641adac6bc0bb1 Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Fri, 14 Jun 2013 15:49:02 +0200 Subject: [PATCH] Fixed crash in CSV statistics writer --- sipp-stats_crash.patch | 21 +++++++++++++++++++++ sipp.spec | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 sipp-stats_crash.patch diff --git a/sipp-stats_crash.patch b/sipp-stats_crash.patch new file mode 100644 index 0000000..ba8b883 --- /dev/null +++ b/sipp-stats_crash.patch @@ -0,0 +1,21 @@ +diff -dur sipp-3.3.orig/stat.cpp sipp-3.3/stat.cpp +--- sipp-3.3.orig/stat.cpp 2013-05-27 10:48:19.000000000 +0200 ++++ sipp-3.3/stat.cpp 2013-05-27 11:00:15.000000000 +0200 +@@ -1140,7 +1140,7 @@ + char* CStat::sRepartitionInfo(T_dynamicalRepartition * tabRepartition, + int sizeOfTab) + { +- static char *repartitionInfo; ++ static char *repartitionInfo = NULL; + char buffer[MAX_CHAR_BUFFER_SIZE]; + int dlen = strlen(stat_delimiter); + +@@ -1148,7 +1148,7 @@ + { + // if a repartition is present, this field match the repartition name + repartitionInfo = (char *)realloc(repartitionInfo, dlen + 1); +- strcpy(stat_delimiter, repartitionInfo); ++ strcpy(repartitionInfo, stat_delimiter); + for(int i=0; i<(sizeOfTab-1); i++) + { + sprintf(buffer, "%lu%s", tabRepartition[i].nbInThisBorder, stat_delimiter); diff --git a/sipp.spec b/sipp.spec index e580d06..c8634c6 100644 --- a/sipp.spec +++ b/sipp.spec @@ -1,4 +1,3 @@ -# Summary: SIPp - a performance testing tool for the SIP protocol Name: sipp Version: 3.3 @@ -9,6 +8,7 @@ Source0: http://dl.sourceforge.net/sipp/%{name}-%{version}.tar.xz # Source0-md5: f0c4f472fa86de8a528cb91616323617 Patch0: %{name}-headers.patch Patch1: %{name}-sprintf.patch +Patch2: %{name}-stats_crash.patch URL: http://sipp.sourceforge.net/ BuildRequires: libpcap-devel BuildRequires: libstdc++-devel @@ -36,6 +36,7 @@ system. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build -- 2.44.0