Skip to content

Commit 31d8495

Browse files
committed
Fix buffer overflow using string_view.
1 parent 6551af1 commit 31d8495

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/common/CvtFormat.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ namespace
249249

250250
constexpr Format::Patterns mapFormatStrToFormatPattern(std::string_view pattern)
251251
{
252+
if (pattern.empty())
253+
return Format::NONE;
254+
252255
switch (pattern[0])
253256
{
254257
case 'Y':

0 commit comments

Comments
 (0)