diff mbox

libsepol: Add missing return to sepol_node_query()

Message ID 1468238367-31812-1-git-send-email-plautrba@redhat.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Petr Lautrbach July 11, 2016, 11:59 a.m. UTC
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

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 libsepol/src/nodes.c | 1 +
 1 file changed, 1 insertion(+)

Comments

James Carter July 12, 2016, 6:31 p.m. UTC | #1
On 07/11/2016 07:59 AM, Petr Lautrbach wrote:
> 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
>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Applied.

Thanks,

> ---
>  libsepol/src/nodes.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libsepol/src/nodes.c b/libsepol/src/nodes.c
> index 50cf21d..820346d 100644
> --- a/libsepol/src/nodes.c
> +++ b/libsepol/src/nodes.c
> @@ -273,6 +273,7 @@ int sepol_node_query(sepol_handle_t * handle,
>  							   c, SEPOL_PROTO_IP6,
>  							   response) < 0)
>  						goto err;
> +					return STATUS_SUCCESS;
>  				}
>  			}
>  			break;
>
diff mbox

Patch

diff --git a/libsepol/src/nodes.c b/libsepol/src/nodes.c
index 50cf21d..820346d 100644
--- a/libsepol/src/nodes.c
+++ b/libsepol/src/nodes.c
@@ -273,6 +273,7 @@  int sepol_node_query(sepol_handle_t * handle,
 							   c, SEPOL_PROTO_IP6,
 							   response) < 0)
 						goto err;
+					return STATUS_SUCCESS;
 				}
 			}
 			break;