Skip to content
Permalink
Browse files Browse the repository at this point in the history
[commissioner] add network name length check in GeneratePskc() (#4404)
  • Loading branch information
jwhui committed Dec 16, 2019
1 parent e8735f4 commit b8c3161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/meshcop/commissioner.cpp
Expand Up @@ -1109,7 +1109,8 @@ otError Commissioner::GeneratePskc(const char * aPassPhrase,
uint16_t saltLen = 0;

VerifyOrExit((strlen(aPassPhrase) >= OT_COMMISSIONING_PASSPHRASE_MIN_SIZE) &&
(strlen(aPassPhrase) <= OT_COMMISSIONING_PASSPHRASE_MAX_SIZE),
(strlen(aPassPhrase) <= OT_COMMISSIONING_PASSPHRASE_MAX_SIZE) &&
(strlen(aNetworkName) <= OT_NETWORK_NAME_MAX_SIZE),
error = OT_ERROR_INVALID_ARGS);

memset(salt, 0, sizeof(salt));
Expand Down

0 comments on commit b8c3161

Please sign in to comment.