summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2013-09-05 13:44:04 -0400
committerGedare Bloom <gedare@rtems.org>2013-09-05 13:44:04 -0400
commitc963ac7e39412434998ca4480df7615beb20d872 (patch)
treefd411ed67e65f102698488ceba032e325b5c3791
parentbdpart: Argument cannot be negative (diff)
downloadrtems-c963ac7e39412434998ca4480df7615beb20d872.tar.bz2
nfs: Fix ln option processing.
If opts is NULL, then strchr() will dereference it and search for 's'. 1063863 Dereference after null check
-rw-r--r--cpukit/libfs/src/nfsclient/src/dirutils.c2
1 files changed, 1 insertions, 1 deletions
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;