[rtems commit] nfs: Fix ln option processing.
Gedare Bloom
gedare at rtems.org
Thu Sep 5 19:07:52 UTC 2013
Module: rtems
Branch: master
Commit: c963ac7e39412434998ca4480df7615beb20d872
Changeset: http://git.rtems.org/rtems/commit/?id=c963ac7e39412434998ca4480df7615beb20d872
Author: Gedare Bloom <gedare at rtems.org>
Date: Thu Sep 5 13:44:04 2013 -0400
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 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 65e2053..d5fd1be 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;
More information about the vc
mailing list