mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Bug 1168938 - Memory safety bug in NetworkUtils::postTetherInterfaceList. r=fabrice
This commit is contained in:
parent
38dc4dbf00
commit
20da5a4b4d
@ -819,7 +819,9 @@ void NetworkUtils::postTetherInterfaceList(CommandChain* aChain,
|
||||
|
||||
char buf[BUF_SIZE];
|
||||
NS_ConvertUTF16toUTF8 reason(aResult.mResultReason);
|
||||
memcpy(buf, reason.get(), reason.Length() + 1);
|
||||
|
||||
size_t length = reason.Length() + 1 < BUF_SIZE ? reason.Length() + 1 : BUF_SIZE;
|
||||
memcpy(buf, reason.get(), length);
|
||||
split(buf, INTERFACE_DELIMIT, GET_FIELD(mInterfaceList));
|
||||
|
||||
doCommand(command, aChain, aCallback);
|
||||
|
Loading…
x
Reference in New Issue
Block a user