Skip to content
Snippets Groups Projects
Commit 71eb46fb authored by Alexandr's avatar Alexandr
Browse files

fixed gh-140 in first approximation

parent 0b171a36
No related branches found
No related tags found
No related merge requests found
......@@ -380,7 +380,10 @@ tuple_new(struct tuple_format *format, uint32_t field_count,
{
size_t tuple_len = end - *data;
if (tuple_len != tuple_range_size(data, end, field_count))
uint32_t test_field_count = field_count;
if (tuple_len != tuple_range_size(data, end, &test_field_count))
tnt_raise(IllegalParams, "tuple_new(): incorrect tuple format");
if (test_field_count > 0)
tnt_raise(IllegalParams, "tuple_new(): incorrect tuple format");
struct tuple *new_tuple = tuple_alloc(format, tuple_len);
......
......@@ -307,10 +307,10 @@ static inline size_t tuple_len(struct tuple *tuple)
}
static inline size_t
tuple_range_size(const char **begin, const char *end, uint32_t count)
tuple_range_size(const char **begin, const char *end, uint32_t *count)
{
const char *start = *begin;
while (*begin < end && count-- > 0) {
while (*begin < end && (*count)-- > 0) {
size_t len = load_varint32(begin);
*begin += len;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment