secilc: Use size_t for file sizes
PATCH 1/1 secilc: Use size_t for file sizes
The programs secil2conf, secilc2tree, and secilc use uint32_t for the value of the size of the input files being read. This could lead to a file larger than 4 GiB being truncated, so use size_t instead.
Signed-off-by James Carter <[email protected]>
--- secilc/secil2conf.c | 2 +- secilc/secil2tree.c | 2 +- secilc/secilc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
secilc/secil2conf.c +1 -1
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])FILE *file =NULL ;char *buffer =NULL ;struct stat filedata; -uint32_t file_size; +size_t file_size;char *output =NULL ;struct cil_db *db =NULL ;int mls =-1 ;
secilc/secil2tree.c +1 -1
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])FILE *file =NULL ;char *buffer =NULL ;struct stat filedata; -uint32_t file_size; +size_t file_size;char *output =NULL ;struct cil_db *db =NULL ;int preserve_tunables =0 ;
secilc/secilc.c +1 -1
@@ -88,7 +88,7 @@ int main(int argc, char *argv[])FILE *file =NULL ;char *buffer =NULL ;struct stat filedata; -uint32_t file_size; +size_t file_size;char *output =NULL ;char *filecontexts =NULL ;struct cil_db *db =NULL ;
Signature · 1 line
2.55.0
Quoted 7 lines · James Carter
The programs secil2conf, secilc2tree, and secilc use
uint32_tfor the value of the size of the input files being read. This could lead to a file larger than 4 GiB being truncated, so usesize_tinstead.Signed-off-by James Carter <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Quoted 48 lines
--- secilc/secil2conf.c | 2 +- secilc/secil2tree.c | 2 +- secilc/secilc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)secilc/secil2conf.c +1
-1@@ -66,7 +66,7 @@ int main(int argc, char *argv[])FILE *file =NULL ;char *buffer =NULL ;struct stat filedata; -uint32_t file_size; +size_t file_size;char *output =NULL ;struct cil_db *db =NULL ;int mls =-1 ;secilc/secil2tree.c +1
-1@@ -71,7 +71,7 @@ int main(int argc, char *argv[])FILE *file =NULL ;char *buffer =NULL ;struct stat filedata; -uint32_t file_size; +size_t file_size;char *output =NULL ;struct cil_db *db =NULL ;int preserve_tunables =0 ;secilc/secilc.c +1
-2@@ -88,7 +88,7 @@ int main(int argc, char *argv[])FILE *file =NULL ;char *buffer =NULL ;struct stat filedata; -uint32_t file_size; +size_t file_size;char *output =NULL ;char *filecontexts =NULL ;struct cil_db *db =NULL ; --2.55.0
Stephen Smalley
maintainerQuoted 11 lines · Stephen Smalley
Quoted 7 lines · James Carter
The programs secil2conf, secilc2tree, and secilc use
uint32_tfor the value of the size of the input files being read. This could lead to a file larger than 4 GiB being truncated, so usesize_tinstead.Signed-off-by James Carter <[email protected]>Acked-by Stephen Smalley <[email protected]>
Merged.