diff options
author | Karel Zak | 2014-07-14 14:53:41 +0200 |
---|---|---|
committer | Karel Zak | 2014-07-14 15:05:22 +0200 |
commit | 7c2cfb18964b00881e65c461742af9038bd5b287 (patch) | |
tree | 03881cd0a38bab944fd9d84df86ce62f90dc1162 /libfdisk/src/context.c | |
parent | build-sys: release++ (v2.25-rc2) (diff) | |
download | kernel-qcow2-util-linux-7c2cfb18964b00881e65c461742af9038bd5b287.tar.gz kernel-qcow2-util-linux-7c2cfb18964b00881e65c461742af9038bd5b287.tar.xz kernel-qcow2-util-linux-7c2cfb18964b00881e65c461742af9038bd5b287.zip |
libfdisk: make first sector buffer usage more robust
$ ~/util-linux/fdisk -b 4096 xxx
..
Segmentation fault
The buffer has to be reinitialized always when we apply a new
device properties (e.g. sector size).
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/context.c')
-rw-r--r-- | libfdisk/src/context.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c index 5fc4c6526..2e224b363 100644 --- a/libfdisk/src/context.c +++ b/libfdisk/src/context.c @@ -180,6 +180,7 @@ static void reset_context(struct fdisk_context *cxt) cxt->dev_fd = -1; cxt->dev_path = NULL; cxt->firstsector = NULL; + cxt->firstsector_bufsz = 0; fdisk_zeroize_device_properties(cxt); |