Commit c0c72635bc99d9a484c60356db8135174104eb4d

Authored by 芯火源
1 parent 9d787505

fix: 鉴权脚本有效性校验完善

... ... @@ -326,8 +326,9 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements
326 326 }
327 327 String token = accessToken.getPassword();
328 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 332 onValidateFailed(ctx, MqttConnectReturnCode.CONNECTION_REFUSED_PAYLOAD_FORMAT_INVALID);
332 333 return;
333 334 }
... ...