mirror of
https://github.com/espressif/openthread.git
synced 2026-08-06 02:37:47 +00:00
[posix] allow empty backbone interface name (#6685)
Add the empty string check for backbone interface.
This commit is contained in:
@@ -50,7 +50,7 @@ void platformBackboneInit(otInstance *aInstance, const char *aInterfaceName)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
VerifyOrExit(aInterfaceName != nullptr);
|
||||
VerifyOrExit(aInterfaceName != nullptr && aInterfaceName[0] != '\0');
|
||||
|
||||
VerifyOrDie(strnlen(aInterfaceName, IFNAMSIZ) <= IFNAMSIZ - 1, OT_EXIT_INVALID_ARGUMENTS);
|
||||
strncpy(gBackboneNetifName, aInterfaceName, sizeof(gBackboneNetifName));
|
||||
|
||||
@@ -273,7 +273,7 @@ void InfraNetif::Init(otInstance *aInstance, const char *aIfName)
|
||||
ssize_t rval;
|
||||
uint32_t ifIndex = 0;
|
||||
|
||||
VerifyOrExit(aIfName != nullptr);
|
||||
VerifyOrExit(aIfName != nullptr && aIfName[0] != '\0');
|
||||
|
||||
VerifyOrDie(strnlen(aIfName, sizeof(mInfraIfName)) <= sizeof(mInfraIfName) - 1, OT_EXIT_INVALID_ARGUMENTS);
|
||||
strcpy(mInfraIfName, aIfName);
|
||||
|
||||
Reference in New Issue
Block a user