Skip to content

Commit

Permalink
imp - Fixed out of bounds in some cases
Browse files Browse the repository at this point in the history
We've fixed out of bounds when trying to split keys and values.

---

We've fixed out of bounds when trying to split keys and values in certain situations. This can be easily reproduced by importing a contact with a picture to Nitrocid KS, which internally uses the SaveTo() and Parse() functions for verification.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Sep 18, 2023
1 parent bcdbbe9 commit fb33db8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions VisualCard/Parsers/VcardParserTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ internal static string[] GetValues(string[] args, string @default, string argSpe

internal static string[] SplitToKeyAndValueFromString(string line)
{
if (line.IndexOf(':') < 0)
return new[] { line, "" };
string key = line.Substring(0, line.IndexOf(':'));
string value = line.Substring(line.IndexOf(':'));
return new[] { key, value };
Expand Down

0 comments on commit fb33db8

Please sign in to comment.