diff options
Diffstat (limited to 'app/src/main/java/com/wireguard/config')
-rw-r--r-- | app/src/main/java/com/wireguard/config/Config.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/config/Config.java b/app/src/main/java/com/wireguard/config/Config.java index b2885710..c7fdcc87 100644 --- a/app/src/main/java/com/wireguard/config/Config.java +++ b/app/src/main/java/com/wireguard/config/Config.java @@ -22,10 +22,11 @@ import java.util.regex.Pattern; public class Config extends BaseObservable implements Comparable<Config>, Copyable<Config>, Observable { + public static final int NAME_MAX_LENGTH = 16; private static final Pattern PATTERN = Pattern.compile("^[a-zA-Z0-9_=+.-]{1,16}$"); private static boolean isNameValid(final String name) { - return PATTERN.matcher(name).matches(); + return name.length() <= NAME_MAX_LENGTH && PATTERN.matcher(name).matches(); } private final Interface iface = new Interface(); |