mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 14:47:46 +00:00
[network-name] implement additional validation rules (#6988)
According to SPEC-981, we need to verify 3 more things while setting a network name: - The name length >= 1. - There are no UTF control characters in the name. - There are no UTF NUL characters in the name. This is covered by the second rule.
This commit is contained in:
@@ -138,6 +138,8 @@ void TestUtf8(void)
|
||||
VerifyOrQuit(!IsValidUtf8String("\xef\x80"));
|
||||
VerifyOrQuit(!IsValidUtf8String("\xf7\x80\x80"));
|
||||
VerifyOrQuit(!IsValidUtf8String("\xff"));
|
||||
VerifyOrQuit(!IsValidUtf8String("NUL\x00NUL", 7)); // UTF-8 NUL
|
||||
VerifyOrQuit(!IsValidUtf8String("abcde\x11")); // control character
|
||||
|
||||
printf(" -- PASS\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user