Permalink
Browse files

Fix alias name length check.

  • Loading branch information...
1 parent dd47cc8 commit e118484931f37b327e2a0562f4d7dac9cb9cfa40 f committed Nov 1, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/java/nxt/TransactionType.java
@@ -431,7 +431,7 @@ boolean isDuplicate(Transaction transaction, Map<TransactionType, Set<String>> d
void validateAttachment(Transaction transaction) throws NxtException.ValidationException {
Attachment.MessagingAliasAssignment attachment = (Attachment.MessagingAliasAssignment) transaction.getAttachment();
if (attachment.getAliasName().length() == 0
- || attachment.getAliasName().length() > Constants.MAX_ALIAS_LENGTH
+ || Convert.toBytes(attachment.getAliasName()).length > Constants.MAX_ALIAS_LENGTH
|| attachment.getAliasURI().length() > Constants.MAX_ALIAS_URI_LENGTH) {
throw new NxtException.NotValidException("Invalid alias assignment: " + attachment.getJSONObject());
}

0 comments on commit e118484

Please sign in to comment.