-
Notifications
You must be signed in to change notification settings - Fork 524
Limit the lenght of User Name #2764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Hunsup Jung <hunsup.jung@samsung.com>
|
Invitation URL: |
Test Results 71 files 485 suites 0s ⏱️ For more details on these failures, see this check. Results for commit 120f200. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 120f200 |
| local userNameMatter = userName | ||
| if #userNameMatter > NAME_MAX_L then | ||
| userNameMatter = string.sub(userNameMatter, 1, NAME_MAX_L) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| local userNameMatter = userName | |
| if #userNameMatter > NAME_MAX_L then | |
| userNameMatter = string.sub(userNameMatter, 1, NAME_MAX_L) | |
| end | |
| local userName = string.sub(command.args.userName, 1, NAME_MAX_L) |
the sub will only limit the userName input if it is too long, so no need for the extra check, or the extra variable
|
|
||
| local INITIAL_CREDENTIAL_INDEX = 1 | ||
| local ALL_INDEX = 0xFFFE | ||
| local NAME_MAX_L = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| local NAME_MAX_L = 10 | |
| -- maximum as defined by the Matter specification | |
| local MAX_USER_NAME_LENGTH = 10 |
| if userIdx == 0 then | ||
| userIdx = nil | ||
| else | ||
| userTypeMatter = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious, why should this be nil if userIdx > 0?
Type of Change
Checklist
Description of Change
Summary of Completed Tests