Skip to contentSkip to conversation

libsepol: Add missing return to sepol_node_query()

PATCH Applied Petr Lautrbach 2 participants 2 messages Jul 11, 2016 – Jul 12, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsepol: Add missing return to sepol_node_query()

Due to the missing return in sepol_node_query(), the function always set *response to NULL whenever a protocol was SEPOL_PROTO_IP6

Fixes:
sudo semanage node -a -M ::1 -p ipv6 -t node_t ::1 sudo semanage node -m -M ::1 -p ipv6 -t node_t ::1
[1] 12968 segmentation fault (core dumped) semanage node -m -M ::1 -p ipv6 -t node_t ::1

---
 libsepol/src/nodes.c | 1 +
 1 file changed, 1 insertion(+)
libsepol/src/nodes.c +1 -0
index 50cf21d..820346d 100644
@@ -273,6 +273,7 @@ int sepol_node_query(sepol_handle_t * handle,
 							   c, SEPOL_PROTO_IP6,
 							   response) < 0)
 						goto err;
+					return STATUS_SUCCESS;
 				}
 			}
 			break;
Signature · 1 line
1.8.3.1
Applied
#1 lore raw
Quoted 9 lines · Petr Lautrbach

Due to the missing return in sepol_node_query(), the function always set *response to NULL whenever a protocol was SEPOL_PROTO_IP6

Fixes:
sudo semanage node -a -M ::1 -p ipv6 -t node_t ::1 sudo semanage node -m -M ::1 -p ipv6 -t node_t ::1
[1] 12968 segmentation fault (core dumped) semanage node -m -M ::1 -p ipv6 -t node_t ::1

Applied.

Thanks,

Quoted 17 lines
---
 libsepol/src/nodes.c | 1 +
 1 file changed, 1 insertion(+)
libsepol/src/nodes.c +1 -0
index 50cf21d..820346d 100644
@@ -273,6 +273,7 @@ int sepol_node_query(sepol_handle_t * handle,
 							   c, SEPOL_PROTO_IP6,
 							   response) < 0)
 						goto err;
+					return STATUS_SUCCESS;
 				}
 			}
 			break;
Signature · 2 lines
James Carter <[email protected]>
National Security Agency