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;
-- 
1.7.1

_______________________________________________
rtems-devel mailing list
rtems-devel@rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel

Reply via email to