Skip to content

Commit

Permalink
gh-901: Some farconfig files causes a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Jan 19, 2025
1 parent a3289bb commit 9772038
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
drkns 2025-01-19 22:00:05+00:00 - build 6419

1. gh-901: Some farconfig files causes a crash.

--------------------------------------------------------------------------------
drkns 2025-01-19 20:58:24+00:00 - build 6418

Expand Down
12 changes: 8 additions & 4 deletions far/configdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,29 @@ bool deserialise_value(std::string_view const Type, char const* Value, auto cons
{
if (Type == "qword"sv)
{
Setter(strtoull(Value, nullptr, 16));
if (Value)
Setter(strtoull(Value, nullptr, 16));
return true;
}

if (Type == "text"sv)
{
Setter(encoding::utf8::get_chars(Value));
if (Value)
Setter(encoding::utf8::get_chars(Value));
return true;
}

if (Type == "base64"sv)
{
Setter(base64::decode(Value));
if (Value)
Setter(base64::decode(Value));
return true;
}

if (Type == "hex"sv)
{
Setter(HexStringToBlob(encoding::utf8::get_chars(Value)));
if (Value)
Setter(HexStringToBlob(encoding::utf8::get_chars(Value)));
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6418
6419

0 comments on commit 9772038

Please sign in to comment.