diff --git a/libsepol/src/policydb.c b/libsepol/src/policydb.c index a84de2ff..ff292f68 100644 --- a/libsepol/src/policydb.c +++ b/libsepol/src/policydb.c @@ -2380,7 +2380,7 @@ int filename_trans_read(filename_trans_t **t, struct policy_file *fp) return -1; len = le32_to_cpu(buf[0]); - name = calloc(len, sizeof(*name)); + name = calloc(len + 1, sizeof(*name)); if (!name) return -1;