diff options
author | Karel Zak <kzak@redhat.com> | 2013-09-09 10:57:50 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2013-09-09 10:57:50 +0200 |
commit | 44baaedaffee029dca76796b933412d97a19dff6 (patch) | |
tree | 78096925383ab5c8b4f56db9b5aab2fe6dd57a73 | |
parent | e6a72859700384a7e0565472ecf5c48a6392be0e (diff) | |
download | util-linux-playground-stable/v2.23.tar.gz |
libfdisk: fix SIGFPEstable/v2.23
#0 recount_geometry at libfdisk/src/alignment.c:143
#1 fdisk_discover_geometry at libfdisk/src/alignment.c:205
#2 fdisk_context_assign_device at libfdisk/src/context.c:173
#3 print_partition_table_from_option at fdisks/fdisk.c:924
References: https://bugzilla.redhat.com/show_bug.cgi?id=1005566
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | libfdisk/src/alignment.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libfdisk/src/alignment.c b/libfdisk/src/alignment.c index ac44e73c11..4d4ab4804b 100644 --- a/libfdisk/src/alignment.c +++ b/libfdisk/src/alignment.c @@ -193,11 +193,12 @@ int fdisk_discover_geometry(struct fdisk_context *cxt) /* what the kernel/bios thinks the geometry is */ blkdev_get_geometry(cxt->dev_fd, &h, &s); - if (!h && !s) { - /* unable to discover geometry, use default values */ - s = 63; + + /* defaults */ + if (!h) h = 255; - } + if (!s) + s = 63; /* obtained heads and sectors */ cxt->geom.heads = h; |