as get_root_path() can use it as a source and fail if
passed pathname contains garbage (on stack);
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I9f628353c872afc82a582b0a6ca960cd0e8cffcb
Reviewed-on: https://review.whamcloud.com/36335
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
int llapi_search_rootpath(char *pathname, const char *fsname)
{
+ /* pathname can be used as an argument by get_root_path(),
+ * clear it for safety */
+ pathname[0] = 0;
return get_root_path(WANT_PATH, (char *)fsname, NULL, pathname, -1);
}