From 5ef53b6fe349c1eb2a1f5d5b91435a5745f57571 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Mon, 23 Nov 2015 12:14:01 -0500 Subject: [PATCH] NIFI-655: - Ensuring the user identity is not too long. --- .../java/org/apache/nifi/admin/dao/impl/StandardUserDAO.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/src/main/java/org/apache/nifi/admin/dao/impl/StandardUserDAO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/src/main/java/org/apache/nifi/admin/dao/impl/StandardUserDAO.java index 8292cac2c2..7648f220cd 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/src/main/java/org/apache/nifi/admin/dao/impl/StandardUserDAO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-administration/src/main/java/org/apache/nifi/admin/dao/impl/StandardUserDAO.java @@ -466,6 +466,11 @@ public class StandardUserDAO implements UserDAO { if (user.getIdentity() == null) { throw new IllegalArgumentException("User identity must be specified."); } + + // ensure the user identity is not too lengthy + if (user.getIdentity().length() > 4096) { + throw new IllegalArgumentException("User identity must be less than 4096 characters."); + } PreparedStatement statement = null; ResultSet rs = null;