Module Name: src
Committed By: jdc
Date: Mon Jul 2 21:39:24 UTC 2012
Modified Files:
src/dist/pdisk [netbsd-6]: partition_map.c
Log Message:
Pull up revision 1.15 (requested by abs in ticket #380).
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.13 -r1.13.8.1 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.13 src/dist/pdisk/partition_map.c:1.13.8.1
--- src/dist/pdisk/partition_map.c:1.13 Sat Apr 18 06:37:35 2009
+++ src/dist/pdisk/partition_map.c Mon Jul 2 21:39:24 2012
@@ -512,12 +512,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");