diff options
author | jkar8572 <jkar8572> | 2010-05-04 12:37:39 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2010-05-04 12:37:39 +0000 |
commit | 940aecfcffe12b565ff0e06d1b6c838a86dfbdd0 (patch) | |
tree | c4bf5d70eae442dddde1efd580a7a4a73105f6e6 | |
parent | 04043443e4a2c9cca6eeac9d67ab6189bf21643c (diff) |
* avoid memory corruption of NULL address (Petr Pisar)
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | quotasys.c | 7 |
2 files changed, 6 insertions, 2 deletions
@@ -1,4 +1,5 @@ Changes in quota-tools from 3.17 to 4.00-pre2 +* avoid memory corruption of NULL address (Petr Pisar) * fixup typos in manpages (Michael Meskes) * added german translation (Michael Bunk) * added --enable-static-link configure option (Jan Kara) @@ -746,9 +746,12 @@ void init_kernel_interface(void) kernel_qfmt_num = 0; if (!stat("/proc/fs/xfs/stat", &st)) kernel_qfmt[kernel_qfmt_num++] = QF_XFS; - else - if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS)) + else { + fs_quota_stat_t dummy; + + if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, (void *)&dummy) || (errno != EINVAL && errno != ENOSYS)) kernel_qfmt[kernel_qfmt_num++] = QF_XFS; + } /* Detect new kernel interface; Assume generic interface unless we can prove there is not one... */ if (!stat("/proc/sys/fs/quota", &st) || errno != ENOENT) { kernel_iface = IFACE_GENERIC; |