402a886
From 940aecfcffe12b565ff0e06d1b6c838a86dfbdd0 Mon Sep 17 00:00:00 2001
402a886
From: jkar8572 <jkar8572>
402a886
Date: Tue, 4 May 2010 12:37:39 +0000
402a886
Subject: [PATCH] * avoid memory corruption of NULL address (Petr Pisar)
b944a1a
402a886
Petr Pisar: Upstream patch without Changelog lines.
b944a1a
b944a1a
diff --git a/quotasys.c b/quotasys.c
402a886
index 8df5e3b..cce5787 100644
b944a1a
--- a/quotasys.c
b944a1a
+++ b/quotasys.c
402a886
@@ -746,9 +746,12 @@ void init_kernel_interface(void)
402a886
 	kernel_qfmt_num = 0;
b944a1a
 	if (!stat("/proc/fs/xfs/stat", &st))
402a886
 		kernel_qfmt[kernel_qfmt_num++] = QF_XFS;
b944a1a
-	else
b944a1a
-		if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS))
b944a1a
+	else {
b944a1a
+		fs_quota_stat_t dummy;
b944a1a
+
402a886
+		if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, (void *)&dummy) || (errno != EINVAL && errno != ENOSYS))
402a886
 			kernel_qfmt[kernel_qfmt_num++] = QF_XFS;
b944a1a
+	}
b944a1a
 	/* Detect new kernel interface; Assume generic interface unless we can prove there is not one... */
b944a1a
 	if (!stat("/proc/sys/fs/quota", &st) || errno != ENOENT) {
b944a1a
 		kernel_iface = IFACE_GENERIC;
402a886
-- 
402a886
1.7.3.2
402a886