Commit 47a57cf2c0e10e8f0d1ba53361861e81cc601015
Merge branch '20230427' into 'master_dev'
fix: 鉴权脚本有效性校验完善 See merge request yunteng/thingskit!186
Showing
1 changed file
with
3 additions
and
2 deletions
... | ... | @@ -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 | } | ... | ... |