зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1241896 - Fix netaddr deserialization for AF_UNSPEC and AF_LOCAL. r=mcmanus
--HG-- extra : commitid : IZc6Z0EDgy3 extra : rebase_source : db0ca5a480b3d9f7eda44b4a39b2c1f0d2a11b06
This commit is contained in:
Родитель
f19e21de56
Коммит
3fc65d4a88
|
@ -108,9 +108,12 @@ struct ParamTraits<mozilla::net::NetAddr>
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (aResult->raw.family == AF_UNSPEC) {
|
if (aResult->raw.family == AF_UNSPEC) {
|
||||||
return aMsg->ReadBytes(aIter,
|
const char *tmp;
|
||||||
reinterpret_cast<const char**>(&aResult->raw.data),
|
if (aMsg->ReadBytes(aIter, &tmp, sizeof(aResult->raw.data))) {
|
||||||
sizeof(aResult->raw.data));
|
memcpy(&(aResult->raw.data), tmp, sizeof(aResult->raw.data));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
} else if (aResult->raw.family == AF_INET) {
|
} else if (aResult->raw.family == AF_INET) {
|
||||||
return ReadParam(aMsg, aIter, &aResult->inet.port) &&
|
return ReadParam(aMsg, aIter, &aResult->inet.port) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->inet.ip);
|
ReadParam(aMsg, aIter, &aResult->inet.ip);
|
||||||
|
@ -122,9 +125,12 @@ struct ParamTraits<mozilla::net::NetAddr>
|
||||||
ReadParam(aMsg, aIter, &aResult->inet6.scope_id);
|
ReadParam(aMsg, aIter, &aResult->inet6.scope_id);
|
||||||
#if defined(XP_UNIX)
|
#if defined(XP_UNIX)
|
||||||
} else if (aResult->raw.family == AF_LOCAL) {
|
} else if (aResult->raw.family == AF_LOCAL) {
|
||||||
return aMsg->ReadBytes(aIter,
|
const char *tmp;
|
||||||
reinterpret_cast<const char**>(&aResult->local.path),
|
if (aMsg->ReadBytes(aIter, &tmp, sizeof(aResult->local.path))) {
|
||||||
sizeof(aResult->local.path));
|
memcpy(&(aResult->local.path), tmp, sizeof(aResult->local.path));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче