From 843cddaaf83abdff0d900af85e8bd2382d834e0d Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 26 Jun 2018 20:28:51 +0800 Subject: [PATCH] qa/workunits/suites/ffsb.sh: fix strncpy bug in ffsb Signed-off-by: Yan, Zheng Fixes: http://tracker.ceph.com/issues/24579 --- qa/workunits/suites/ffsb.patch | 12 ++++++++++++ qa/workunits/suites/ffsb.sh | 1 + 2 files changed, 13 insertions(+) create mode 100644 qa/workunits/suites/ffsb.patch diff --git a/qa/workunits/suites/ffsb.patch b/qa/workunits/suites/ffsb.patch new file mode 100644 index 00000000000..a5121759599 --- /dev/null +++ b/qa/workunits/suites/ffsb.patch @@ -0,0 +1,12 @@ +diff -urp 1/parser.c 2/parser.c +--- 1/parser.c 2008-10-28 04:17:05.000000000 +0800 ++++ 2/parser.c 2018-06-26 20:25:59.000000000 +0800 +@@ -203,7 +203,7 @@ static char *get_optstr(char *buf, char + len = strnlen(string, BUFSIZE); + sprintf(search_str, "%s=%%%ds\\n", string, BUFSIZE - len-1); + if (1 == sscanf(line, search_str, &temp)) { +- len = strnlen(temp, 4096); ++ len = strnlen(temp, 4095) + 1; + ret_buf = malloc(len); + strncpy(ret_buf, temp, len); + return ret_buf; diff --git a/qa/workunits/suites/ffsb.sh b/qa/workunits/suites/ffsb.sh index da0ab8f09a0..ec7e3fbb264 100755 --- a/qa/workunits/suites/ffsb.sh +++ b/qa/workunits/suites/ffsb.sh @@ -7,6 +7,7 @@ mydir=`dirname $0` wget http://download.ceph.com/qa/ffsb.tar.bz2 tar jxvf ffsb.tar.bz2 cd ffsb-* +patch -p1 < $mydir/ffsb.patch ./configure make cd ..