[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/17] libdiskfs: fix consistency check
From: |
Justus Winter |
Subject: |
[PATCH 01/17] libdiskfs: fix consistency check |
Date: |
Thu, 11 Jul 2013 18:09:04 +0200 |
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.
* libdiskfs/file-set-trans.c (diskfs_S_file_set_translator): Fix sanity check.
---
libdiskfs/file-set-trans.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index 3798001..49303e7 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -43,7 +43,7 @@ diskfs_S_file_set_translator (struct protid *cred,
if ((passive_flags & FS_TRANS_SET) && diskfs_check_readonly ())
return EROFS;
- if (passive && passive[passivelen - 1])
+ if (passivelen && passive[passivelen - 1])
return EINVAL;
np = cred->po->np;
--
1.7.10.4
- RFC: get_translator_info, needed for a mtab translator, Justus Winter, 2013/07/03
- [PATCH] get_translator_info wip, Justus Winter, 2013/07/03
- Re: [PATCH] get_translator_info wip, Samuel Thibault, 2013/07/08
- [PATCH 02/17] libnetfs: fix consistency check, Justus Winter, 2013/07/11
- [PATCH 03/17] libdiskfs: track file name in struct peropen, Justus Winter, 2013/07/11
- [PATCH 04/17] libnetfs: track file name in struct peropen, Justus Winter, 2013/07/11
- [PATCH 08/17] libtrivfs: add fsys_get_children, Justus Winter, 2013/07/11
- [PATCH 09/17] trans/symlink.c: add fsys_get_children, Justus Winter, 2013/07/11
- [PATCH 05/17] libfshelp: add translator-list.c, Justus Winter, 2013/07/11
- [PATCH 06/17] libdiskfs: add fsys_get_children, Justus Winter, 2013/07/11
- [PATCH 07/17] libnetfs: add fsys_get_children, Justus Winter, 2013/07/11
- [PATCH 10/17] hurd: add fsys_get_children, Justus Winter, 2013/07/11