Skip to contentSkip to conversation

libsepol: fix direct leak in user_extra_to_cil()

PATCH In review Stephen Smalley 2 participants 3 messages Jul 31 SELinux security module

lore
Share & tools
lore

Stephen Smalley

author maintainer
#0 lore raw

PATCH 1/1 libsepol: fix direct leak in user_extra_to_cil()

Free all the strings on the exit path.

Reported-by oss-fuzz (issue 539257834)
---
 libsepol/src/module_to_cil.c | 2 ++
 1 file changed, 2 insertions(+)
libsepol/src/module_to_cil.c +2 -0
index 2aaf4feb..06fbdc30 100644
@@ -3680,6 +3680,8 @@ exit:
 	free(line);
 	free(user);
 	free(prefix);
+	free(user_str);
+	free(prefix_str);
 
 	return rc;
 }
Signature · 1 line
2.55.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Stephen Smalley

Free all the strings on the exit path.

Reported-by oss-fuzz (issue 539257834)
Quoted 20 lines
---
 libsepol/src/module_to_cil.c | 2 ++
 1 file changed, 2 insertions(+)
libsepol/src/module_to_cil.c +2 -1
index 2aaf4feb..06fbdc30 100644
@@ -3680,6 +3680,8 @@ exit:
        free(line);
        free(user);
        free(prefix);
+       free(user_str);
+       free(prefix_str);
 
        return rc;
 }
--

2.55.0