fixes #6302 Need set a max length

Fixed the issue and pushed the changes, please check it.