Skip to content

Commit

Permalink
Avoid integer overflow by disallowing Unicode sequences of more than …
Browse files Browse the repository at this point in the history
…6 digits. See #335.
  • Loading branch information
samhocevar committed Jun 18, 2020
1 parent a3286c2 commit b771c98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/settings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ public static bool GetGenericSequenceResult(KeySequence sequence, out string res
return true;
}

private static Regex m_match_gen_prefix = new Regex(@"^[uU][0-9a-fA-F]*$");
private static Regex m_match_gen_seq = new Regex(@"^[uU]([0-9a-fA-F]+)( |{return})$");
private static Regex m_match_gen_prefix = new Regex(@"^[uU][0-9a-fA-F]{0,6}$");
private static Regex m_match_gen_seq = new Regex(@"^[uU]([0-9a-fA-F]{1,6})( |{return})$");

public static List<SequenceDescription> GetSequenceDescriptions() => m_sequences.GetSequenceDescriptions();

Expand Down

0 comments on commit b771c98

Please sign in to comment.