Blame numactl-2.0.7-numademo-msize-check.patch

Petr Holasek fae4fe
diff -up numactl-2.0.7/numademo.c.orig numactl-2.0.7/numademo.c
Petr Holasek fae4fe
--- numactl-2.0.7/numademo.c.orig	2012-02-15 12:35:33.450409388 +0100
Petr Holasek fae4fe
+++ numactl-2.0.7/numademo.c	2012-02-15 12:37:20.094416633 +0100
Petr Holasek fae4fe
@@ -522,7 +522,13 @@ int main(int ac, char **av)
Petr Holasek fae4fe
 #ifdef HAVE_STREAM_LIB
Petr Holasek fae4fe
 		test(STREAM);
Petr Holasek fae4fe
 #endif
Petr Holasek fae4fe
-		test(PTRCHASE);
Petr Holasek fae4fe
+		if (msize >= sizeof(union node)) {
Petr Holasek fae4fe
+			test(PTRCHASE);
Petr Holasek fae4fe
+		} else {
Petr Holasek fae4fe
+			fprintf(stderr, "You must set msize at least %lu bytes for ptrchase test.\n",
Petr Holasek fae4fe
+				sizeof(union node));
Petr Holasek fae4fe
+			exit(1);
Petr Holasek fae4fe
+		}
Petr Holasek fae4fe
 	} else {
Petr Holasek fae4fe
 		int k;
Petr Holasek fae4fe
 		for (k = 2; k < ac; k++) {