Showing
1 changed file
with
3 additions
and
2 deletions
@@ -326,8 +326,9 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements | @@ -326,8 +326,9 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements | ||
326 | } | 326 | } |
327 | String token = accessToken.getPassword(); | 327 | String token = accessToken.getPassword(); |
328 | if (null == token | 328 | if (null == token |
329 | - || StringUtils.isEmpty(token) | ||
330 | - || Pattern.compile(".*[\\s\u0000]+.*").matcher(token).matches()) { | 329 | + || StringUtils.isEmpty(token) |
330 | + || token.contains("\000") | ||
331 | + || Pattern.compile(".*[\\s\u0000]+.*").matcher(token).matches()) { | ||
331 | onValidateFailed(ctx, MqttConnectReturnCode.CONNECTION_REFUSED_PAYLOAD_FORMAT_INVALID); | 332 | onValidateFailed(ctx, MqttConnectReturnCode.CONNECTION_REFUSED_PAYLOAD_FORMAT_INVALID); |
332 | return; | 333 | return; |
333 | } | 334 | } |