diff options
author | Ruediger Meier | 2016-10-26 17:04:30 +0200 |
---|---|---|
committer | Karel Zak | 2016-10-27 10:43:45 +0200 |
commit | 14b7f754c9abb0ea213d7824766496e6a0152c58 (patch) | |
tree | af2969642827bd985935fbef74b88b4ed3193cc6 /libfdisk | |
parent | tests: add sfdisk script case-insensitive test (diff) | |
download | kernel-qcow2-util-linux-14b7f754c9abb0ea213d7824766496e6a0152c58.tar.gz kernel-qcow2-util-linux-14b7f754c9abb0ea213d7824766496e6a0152c58.tar.xz kernel-qcow2-util-linux-14b7f754c9abb0ea213d7824766496e6a0152c58.zip |
libfdisk: fix uninitialized fdisk_labelitem
fdisk -l could crash randomly. Only seen on some i586 systems with
certain exotic compiler options.
The problem was that this item is later used in
function fdisk_reset_labelitem() like this:
if (li->type == 's')
free(li->data.str);
This may crash if item is randomly initialized.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'libfdisk')
-rw-r--r-- | libfdisk/src/label.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c index 5cbbe422e..0e83fdf34 100644 --- a/libfdisk/src/label.c +++ b/libfdisk/src/label.c @@ -416,7 +416,7 @@ int fdisk_locate_disklabel(struct fdisk_context *cxt, int n, const char **name, */ int fdisk_get_disklabel_id(struct fdisk_context *cxt, char **id) { - struct fdisk_labelitem item; + struct fdisk_labelitem item = {0}; int rc; if (!cxt || !cxt->label || !id) |