summaryrefslogtreecommitdiff
path: root/libnetfs
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-07-11 18:09:05 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-15 09:52:01 +0200
commit5534751bfc13761fd87c667cd3f3719575adac2a (patch)
treecb454a4b1ba3dd1bfc42482fe2cdeddc19d03101 /libnetfs
parent73097d3e1e737f4885b96fc47416a013bd5a4d76 (diff)
libnetfs: fix consistency check
passive is not a zero terminated string but a char * combined with a length. If passivelen == 0, passive may very well be not NULL, and dereferencing that pointer might not be safe. At the very least the consistency check is wrong. Fix that by checking passivelen instead of passive. * libnetfs/file-set-trans.c (netfs_S_file_set_translator): Fix sanity check.
Diffstat (limited to 'libnetfs')
-rw-r--r--libnetfs/file-set-translator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libnetfs/file-set-translator.c b/libnetfs/file-set-translator.c
index 4c29d952..b107ccd5 100644
--- a/libnetfs/file-set-translator.c
+++ b/libnetfs/file-set-translator.c
@@ -39,7 +39,7 @@ netfs_S_file_set_translator (struct protid *user,
if (!(passive_flags & FS_TRANS_SET) && !(active_flags & FS_TRANS_SET))
return 0;
- if (passive && passive[passivelen - 1])
+ if (passivelen && passive[passivelen - 1])
return EINVAL;
np = user->po->np;