diff options
-rw-r--r-- | libglusterfs/src/gfdb/gfdb_data_store_helper.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_data_store_helper.c b/libglusterfs/src/gfdb/gfdb_data_store_helper.c index d5cfb24eeba..39a97ff73d9 100644 --- a/libglusterfs/src/gfdb/gfdb_data_store_helper.c +++ b/libglusterfs/src/gfdb/gfdb_data_store_helper.c @@ -562,6 +562,14 @@ gfdb_read_query_record (int fd, goto out; } + /* Assumed sane range is 1B - 10MB */ + if ((buffer_len <= 0) || (buffer_len > (10 * 1024 * 1024))) { + ret = -1; + gf_msg (GFDB_DATA_STORE, GF_LOG_ERROR, 0, LG_MSG_DB_ERROR, + "buffer length range is out of bound %d", buffer_len); + goto out; + } + /* Allocating memory to the serialization buffer */ buffer = GF_CALLOC (1, buffer_len, gf_common_mt_char); if (!buffer) { |