From: Jeff Layton Date: Sat, 5 Apr 2014 12:45:57 +0000 (-0400) Subject: nfs: pass string length to pr_notice message about readdir loops X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9581a4ae75517099bc87e1c43d1a8f35b55741b9;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git nfs: pass string length to pr_notice message about readdir loops There is no guarantee that the strings in the nfs_cache_array will be NULL-terminated. In the event that we end up hitting a readdir loop, we need to ensure that we pass the warning message the length of the string. Reported-by: Lachlan McIlroy Signed-off-by: Jeff Layton Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b31f5d2400bd..ef3fd090f59a 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -313,10 +313,9 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des if (printk_ratelimit()) { pr_notice("NFS: directory %pD2 contains a readdir loop." "Please contact your server vendor. " - "The file: %s has duplicate cookie %llu\n", - desc->file, - array->array[i].string.name, - *desc->dir_cookie); + "The file: %.*s has duplicate cookie %llu\n", + desc->file, array->array[i].string.len, + array->array[i].string.name, *desc->dir_cookie); } status = -ELOOP; goto out;