From c963ac7e39412434998ca4480df7615beb20d872 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Thu, 5 Sep 2013 13:44:04 -0400 Subject: nfs: Fix ln option processing. If opts is NULL, then strchr() will dereference it and search for 's'. 1063863 Dereference after null check --- cpukit/libfs/src/nfsclient/src/dirutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/libfs/src/nfsclient/src/dirutils.c b/cpukit/libfs/src/nfsclient/src/dirutils.c index 65e2053ddc..d5fd1be131 100644 --- a/cpukit/libfs/src/nfsclient/src/dirutils.c +++ b/cpukit/libfs/src/nfsclient/src/dirutils.c @@ -326,7 +326,7 @@ ln(char *to, char *name, char *opts) } name++; } - if (opts || strchr(opts,'s')) { + if (opts && strchr(opts,'s')) { if (symlink(name,to)) { fprintf(stderr,"symlink: %s\n",strerror(errno)); return -1; -- cgit v1.2.3