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>
*/
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)