diff mbox series

[4/5] libsepol: drop superfluous check

Message ID 20230713180816.101924-4-cgzones@googlemail.com (mailing list archive)
State Not Applicable
Delegated to: Petr Lautrbach
Headers show
Series [1/5] libsepol: free memory on str_read() failures | expand

Commit Message

Christian Göttsche July 13, 2023, 6:08 p.m. UTC
str_read() internally performs a sanity length check.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libsepol/src/policydb.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/libsepol/src/policydb.c b/libsepol/src/policydb.c
index 552eb77a..e1f8bb06 100644
--- a/libsepol/src/policydb.c
+++ b/libsepol/src/policydb.c
@@ -3560,8 +3560,6 @@  static int filename_trans_rule_read(policydb_t *p, avrule_t **r,
 			return -1;
 
 		len = le32_to_cpu(buf[0]);
-		if (zero_or_saturated(len))
-			return -1;
 
 		rc = str_read(&cur->object_name, fp, len);
 		if (rc)