mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1057973 - Part 2: QueryInterface(Ci.nsIRilNetworkInterface) before accessing serviceId property. r=vyang
This commit is contained in:
parent
42e1632096
commit
79d5c38d10
@ -279,12 +279,9 @@ NetworkManager.prototype = {
|
||||
getNetworkId: function(network) {
|
||||
let id = "device";
|
||||
#ifdef MOZ_B2G_RIL
|
||||
if (this.isNetworkTypeMobile(network.type)) {
|
||||
if (!(network instanceof Ci.nsIRilNetworkInterface)) {
|
||||
throw Components.Exception("Mobile network not an nsIRilNetworkInterface",
|
||||
Cr.NS_ERROR_INVALID_ARG);
|
||||
}
|
||||
id = "ril" + network.serviceId;
|
||||
if (network instanceof Ci.nsIRilNetworkInterface) {
|
||||
let rilNetwork = network.QueryInterface(Ci.nsIRilNetworkInterface);
|
||||
id = "ril" + rilNetwork.serviceId;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -796,9 +793,11 @@ NetworkManager.prototype = {
|
||||
for each (let network in this.networkInterfaces) {
|
||||
if (network.type == type) {
|
||||
#ifdef MOZ_B2G_RIL
|
||||
if (serviceId != undefined && this.isNetworkTypeMobile(network.type) &&
|
||||
network.serviceId != serviceId) {
|
||||
continue;
|
||||
if (network instanceof Ci.nsIRilNetworkInterface) {
|
||||
let rilNetwork = network.QueryInterface(Ci.nsIRilNetworkInterface);
|
||||
if (rilNetwork.serviceId != serviceId) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return network;
|
||||
|
Loading…
Reference in New Issue
Block a user