Whamcloud - gitweb
LU-12447 utils: specify correct size for lfs project buffer
[fs/lustre-release.git] / lustre / utils / lfs_project.c
index 55caae5..f16d825 100644 (file)
@@ -69,7 +69,7 @@ lfs_project_item_alloc(struct list_head *head, const char *pathname)
                return -ENOMEM;
        }
 
                return -ENOMEM;
        }
 
-       strncpy(lpi->lpi_pathname, pathname, sizeof(lpi->lpi_pathname));
+       strncpy(lpi->lpi_pathname, pathname, sizeof(lpi->lpi_pathname) - 1);
        list_add_tail(&lpi->lpi_list, head);
 
        return 0;
        list_add_tail(&lpi->lpi_list, head);
 
        return 0;