Check argument index

This commit is contained in:
Victor Zverovich 2017-07-12 13:24:51 -04:00
parent 4193485b43
commit 8f4b918c5b

View File

@ -1626,10 +1626,12 @@ class basic_args {
uint64_t num_args = -signed_types; uint64_t num_args = -signed_types;
return index < num_args ? args_[index] : format_arg(); return index < num_args ? args_[index] : format_arg();
} }
if (index > internal::MAX_PACKED_ARGS)
return format_arg();
format_arg arg; format_arg arg;
if (index > internal::MAX_PACKED_ARGS)
return arg;
arg.type_ = type(index); arg.type_ = type(index);
if (arg.type_ == internal::NONE)
return arg;
internal::value<Context> &val = arg.value_; internal::value<Context> &val = arg.value_;
val = values_[index]; val = values_[index];
return arg; return arg;