]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/suites/ffsb.sh: fix strncpy bug in ffsb 22718/head
authorYan, Zheng <zyan@redhat.com>
Tue, 26 Jun 2018 12:28:51 +0000 (20:28 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 26 Jun 2018 12:29:21 +0000 (20:29 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Fixes: http://tracker.ceph.com/issues/24579
qa/workunits/suites/ffsb.patch [new file with mode: 0644]
qa/workunits/suites/ffsb.sh

diff --git a/qa/workunits/suites/ffsb.patch b/qa/workunits/suites/ffsb.patch
new file mode 100644 (file)
index 0000000..a512175
--- /dev/null
@@ -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;
index da0ab8f09a08542e10e4f30e2a21af7fcf9426d1..ec7e3fbb264332a9b22279112a63c937e6734d7e 100755 (executable)
@@ -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 ..