Module Name:    src
Committed By:   abs
Date:           Mon Jun 25 16:47:03 UTC 2012

Modified Files:
        src/dist/pdisk: partition_map.c

Log Message:
Casting an uint32_t pointer to (long *) may have been acceptable
in the eighties but that time has long past. Minimally invasive
fix using a temporary long variable, so while we can still overflow
at least we're less broken.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/dist/pdisk/partition_map.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/pdisk/partition_map.c
diff -u src/dist/pdisk/partition_map.c:1.14 src/dist/pdisk/partition_map.c:1.15
--- src/dist/pdisk/partition_map.c:1.14	Fri Apr  6 22:41:47 2012
+++ src/dist/pdisk/partition_map.c	Mon Jun 25 16:47:03 2012
@@ -514,12 +514,14 @@ create_partition_map(char *name, partiti
 	default_number = number;
 	flush_to_newline(0);
 	do {
+	    long long_number = number;
 	    if (get_number_argument("what should be the size? ", 
-		    (long *)&number, default_number) == 0) {
+		    &long_number, default_number) == 0) {
 		printf("Not a number\n");
 		flush_to_newline(1);
 		number = 0;
 	    } else {
+		number = long_number;
 		multiple = get_multiplier(map->logical_block);
 		if (multiple == 0) {
 		    printf("Bad multiplier\n");

Reply via email to