From: Arne Redlich Date: Sun, 9 Mar 2014 20:55:42 +0000 (+0100) Subject: nfs_normalize_path: don't strip trailing slash from "/" X-Git-Tag: upstream/1.9.6^2~55 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=d5f7880641c979b986f6c4d7b6502bd7e768a9ea nfs_normalize_path: don't strip trailing slash from "/" Otherwise end up with a null string which is not permitted (RFC 1813, 3.2; the code checks for it right after the now fixed nullification of "/"). Signed-off-by: Arne Redlich --- diff --git a/lib/libnfs.c b/lib/libnfs.c index a237f60..9053ab1 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -994,7 +994,7 @@ static int nfs_normalize_path(struct nfs_context *nfs, char *path) /* /$ -> \0 */ len = strlen(path); - if (len >= 1) { + if (len > 1) { if (path[len - 1] == '/') { path[len - 1] = '\0'; len--;