volume_key/volume_key-0.3.12-fix_nullderef.patch
Michal Hlavinka 89eda2de1c fix null pointer dereference (RHEL-134662)
Resolves: RHEL-134662
2026-06-17 23:03:01 +02:00

14 lines
450 B
Diff

diff --git a/lib/volume.c b/lib/volume.c
index bfcc383..8d3a53d 100644
--- a/lib/volume.c
+++ b/lib/volume.c
@@ -281,7 +281,7 @@ libvk_volume_free (struct libvk_volume *vol)
{
g_return_if_fail (vol != NULL);
- if (strcmp (vol->format, LIBVK_VOLUME_FORMAT_LUKS) == 0
+ if (vol->format != NULL && strcmp (vol->format, LIBVK_VOLUME_FORMAT_LUKS) == 0
&& vol->v.luks != NULL)
luks_volume_free (vol->v.luks);
g_free (vol->hostname);