зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1278504 - fixed buffer not null terminated. r=valentin
MozReview-Commit-ID: 4V1YcK2thiF --HG-- extra : rebase_source : d7b574f8a36de604d7d48c33ca8b920a5659dbb5
This commit is contained in:
Родитель
27e75b365b
Коммит
932e09d8e4
|
@ -68,7 +68,7 @@ ListInterfaceAddresses(int aFd, const char* aInterface, AddrMapType& aAddrMap)
|
||||||
{
|
{
|
||||||
struct ifreq ifreq;
|
struct ifreq ifreq;
|
||||||
memset(&ifreq, 0, sizeof(struct ifreq));
|
memset(&ifreq, 0, sizeof(struct ifreq));
|
||||||
strncpy(ifreq.ifr_name, aInterface, IFNAMSIZ);
|
strncpy(ifreq.ifr_name, aInterface, IFNAMSIZ - 1);
|
||||||
if (ioctl(aFd, SIOCGIFADDR, &ifreq) != 0) {
|
if (ioctl(aFd, SIOCGIFADDR, &ifreq) != 0) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ ListInterfaceAddresses(int aFd, const char* aInterface, AddrMapType& aAddrMap)
|
||||||
{
|
{
|
||||||
struct ifreq ifreq;
|
struct ifreq ifreq;
|
||||||
memset(&ifreq, 0, sizeof(struct ifreq));
|
memset(&ifreq, 0, sizeof(struct ifreq));
|
||||||
strncpy(ifreq.ifr_name, aInterface, IFNAMSIZ);
|
strncpy(ifreq.ifr_name, aInterface, IFNAMSIZ - 1);
|
||||||
if (ioctl(aFd, SIOCGIFADDR, &ifreq) != 0) {
|
if (ioctl(aFd, SIOCGIFADDR, &ifreq) != 0) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче