diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-12-10 16:07:53 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-12-10 16:07:53 -0800 |
commit | 2e921d4c98de3c6342daadbfdfea06f96d440548 (patch) | |
tree | d3bf735af7335f36fee11c4ca38bd9a1c4945966 /src/cstore/unionfs/cstore-unionfs.cpp | |
parent | d838fe9235b8ff44938d0513edb7e2bfd96440fe (diff) | |
download | vyatta-cfg-2e921d4c98de3c6342daadbfdfea06f96d440548.tar.gz vyatta-cfg-2e921d4c98de3c6342daadbfdfea06f96d440548.zip |
fix for bug 6026
* for unionfs cstore implementation, enforce file size limit on both read and write and raise limit to 256 KB.
Diffstat (limited to 'src/cstore/unionfs/cstore-unionfs.cpp')
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index e2e27c6..da5d68e 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -1021,6 +1021,10 @@ UnionfsCstore::get_all_child_dir_names(b_fs::path root, vector<string>& nodes) bool UnionfsCstore::write_file(const string& file, const string& data) { + if (data.size() > C_UNIONFS_MAX_FILE_SIZE) { + output_internal("write_file too large\n"); + return false; + } try { // make sure the path exists b_fs::path fpath(file); @@ -1048,7 +1052,8 @@ UnionfsCstore::read_whole_file(const b_fs::path& fpath, string& data) return false; } try { - if (b_fs::file_size(fpath) > MAX_FILE_READ_SIZE) { + if (b_fs::file_size(fpath) > C_UNIONFS_MAX_FILE_SIZE) { + output_internal("read_whole_file too large\n"); return false; } |