[tbb-commits] [tor-browser] 14/14: Bug 1789808 - Fix buffer overflow, r=necko-reviewers, dragana, a=dmeehan
gitolite role
git at cupani.torproject.org
Thu Nov 17 14:03:53 UTC 2022
This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch tor-browser-91.13.0esr-11.5-1
in repository tor-browser.
commit e75d285bdf66afdd8ef5e7d7aeed757e45edcf3c
Author: Kershaw Chang <kershaw at mozilla.com>
AuthorDate: Tue Oct 18 08:18:20 2022 +0000
Bug 1789808 - Fix buffer overflow, r=necko-reviewers,dragana, a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D158654
---
netwerk/system/mac/nsNetworkLinkService.mm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/netwerk/system/mac/nsNetworkLinkService.mm b/netwerk/system/mac/nsNetworkLinkService.mm
index 09dd4650107a..4509e30085cc 100644
--- a/netwerk/system/mac/nsNetworkLinkService.mm
+++ b/netwerk/system/mac/nsNetworkLinkService.mm
@@ -246,11 +246,14 @@ static bool scanArp(char* ip, char* mac, size_t maclen) {
if (st == 0 || errno != ENOMEM) {
break;
}
- needed += needed / 8;
- auto tmp = MakeUnique<char[]>(needed);
+ size_t increased = needed;
+ increased += increased / 8;
+
+ auto tmp = MakeUnique<char[]>(increased);
memcpy(&tmp[0], &buf[0], needed);
buf = std::move(tmp);
+ needed = increased;
}
if (st == -1) {
return false;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the tbb-commits
mailing list