diff mbox

[1/1] checkpolicy: dereference rangehead after checking it was not NULL

Message ID 20170317221003.18666-1-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss March 17, 2017, 10:10 p.m. UTC
Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 checkpolicy/policy_define.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Carter March 21, 2017, 6:29 p.m. UTC | #1
On 03/17/2017 06:10 PM, Nicolas Iooss wrote:
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Applied.

Thanks,
Jim

> ---
>  checkpolicy/policy_define.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c
> index dbafadb01e21..949ca7117233 100644
> --- a/checkpolicy/policy_define.c
> +++ b/checkpolicy/policy_define.c
> @@ -1924,11 +1924,11 @@ int avrule_ioctl_ranges(struct av_ioctl_range_list **rangelist)
>  	/* read in ranges to include and omit */
>  	if (avrule_read_ioctls(&rangehead))
>  		return -1;
> -	omit = rangehead->omit;
>  	if (rangehead == NULL) {
>  		yyerror("error processing ioctl commands");
>  		return -1;
>  	}
> +	omit = rangehead->omit;
>  	/* sort and merge the input ioctls */
>  	if (avrule_sort_ioctls(&rangehead))
>  		return -1;
>
diff mbox

Patch

diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c
index dbafadb01e21..949ca7117233 100644
--- a/checkpolicy/policy_define.c
+++ b/checkpolicy/policy_define.c
@@ -1924,11 +1924,11 @@  int avrule_ioctl_ranges(struct av_ioctl_range_list **rangelist)
 	/* read in ranges to include and omit */
 	if (avrule_read_ioctls(&rangehead))
 		return -1;
-	omit = rangehead->omit;
 	if (rangehead == NULL) {
 		yyerror("error processing ioctl commands");
 		return -1;
 	}
+	omit = rangehead->omit;
 	/* sort and merge the input ioctls */
 	if (avrule_sort_ioctls(&rangehead))
 		return -1;