Skip to contentSkip to conversation

checkpolicy: dereference rangehead after checking it was not NULL

PATCH Applied Nicolas Iooss 2 participants 2 messages Mar 17, 2017 – Mar 21, 2017 SELinux security module

lore
Share & tools
lore
#0 lore raw

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

---
 checkpolicy/policy_define.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_define.c +1 -1
index dbafadb01e21..949ca7117233 100644
@@ -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;
Signature · 1 line
2.12.0
Applied
#1 lore raw
Quoted 1 line · Nicolas Iooss

Applied.

Thanks,
Jim

Quoted 22 lines
---
 checkpolicy/policy_define.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checkpolicy/policy_define.c +1 -1
index dbafadb01e21..949ca7117233 100644
@@ -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;
Signature · 2 lines
James Carter <[email protected]>
National Security Agency