3
0
forked from pool/libselinux
libselinux/libselinux-set-free-d-data-to-NULL.patch
Hu 984e3188e2 Accepting request 1186962 from home:cahu:security:SELinux:userspace37
- Fix segfault caused by upstream changes in selabel_open():
  libselinux-set-free-d-data-to-NULL.patch 
  Can be removed once it is upstream.

OBS-URL: https://build.opensuse.org/request/show/1186962
OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libselinux?expand=0&rev=172
2024-07-11 19:59:25 +00:00

49 lines
1.5 KiB
Diff

Index: libselinux-3.7/src/label_backends_android.c
===================================================================
--- libselinux-3.7.orig/src/label_backends_android.c
+++ libselinux-3.7/src/label_backends_android.c
@@ -260,6 +260,7 @@ static void closef(struct selabel_handle
free(data->spec_arr);
free(data);
+ rec->data = NULL;
}
static struct selabel_lookup_rec *property_lookup(struct selabel_handle *rec,
Index: libselinux-3.7/src/label_file.c
===================================================================
--- libselinux-3.7.orig/src/label_file.c
+++ libselinux-3.7/src/label_file.c
@@ -942,6 +942,7 @@ static void closef(struct selabel_handle
free(last_area);
}
free(data);
+ rec->data = NULL;
}
// Finds all the matches of |key| in the given context. Returns the result in
Index: libselinux-3.7/src/label_media.c
===================================================================
--- libselinux-3.7.orig/src/label_media.c
+++ libselinux-3.7/src/label_media.c
@@ -183,6 +183,7 @@ static void close(struct selabel_handle
free(spec_arr);
free(data);
+ rec->data = NULL;
}
static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,
Index: libselinux-3.7/src/label_x.c
===================================================================
--- libselinux-3.7.orig/src/label_x.c
+++ libselinux-3.7/src/label_x.c
@@ -210,6 +210,7 @@ static void close(struct selabel_handle
free(spec_arr);
free(data);
+ rec->data = NULL;
}
static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,