Commit 47a57cf2c0e10e8f0d1ba53361861e81cc601015

Authored by xp.Huang
2 parents 9d787505 c0c72635

Merge branch '20230427' into 'master_dev'

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

See merge request yunteng/thingskit!186
... ... @@ -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 }
... ...