Whamcloud - gitweb
LU-10070 lod: SEL: Repeated components
[fs/lustre-release.git] / lustre / tests / llapi_fid_test.c
index be3866c..8f2f946 100644 (file)
@@ -22,6 +22,9 @@
 
 /*
  * Copyright 2014 Cray Inc, all rights reserved.
+ *
+ * Copyright (c) 2016, Intel Corporation.
+ *
  * Author: Frank Zago.
  *
  * A few portions are extracted from llapi_layout_test.c
@@ -330,7 +333,7 @@ static void test20(void)
        /* Create subdirectories as long as we can. Each new subdir is
         * "/x", so we need at least 3 characters left in testpath. */
        while (len <= sizeof(testpath) - 3) {
-               strncat(testpath, "/x", 2);
+               strncat(testpath, "/x", sizeof(testpath) - 1);
 
                len += 2;
 
@@ -366,7 +369,7 @@ static void test30(void)
                bool seen;
        } links[num_links];
        char buf[PATH_MAX];
-       char buf2[PATH_MAX];
+       char buf2[PATH_MAX * 2];
        struct lu_fid fid;
        char fidstr[FID_LEN + 1];
        int rc;