Skip to content

Commit a8f522b

Browse files
committed
Fix CodeQL alert
1 parent cf1f55f commit a8f522b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: include/fmt/base.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,9 @@ template <typename Context> class basic_format_args {
19021902
if (id >= detail::max_packed_args) return arg;
19031903
arg.type_ = type(id);
19041904
if (arg.type_ == detail::type::none_type) return arg;
1905-
arg.value_ = values_[id];
1905+
if (id >= 0) {
1906+
arg.value_ = values_[id];
1907+
}
19061908
return arg;
19071909
}
19081910

0 commit comments

Comments
 (0)