Closed Bug 555661 Opened 10 years ago Closed 3 years ago

mozilla::plugins::PluginInstanceChild::InternalGetNPObjectForValue should fail for unknown NPNVariable aValue

Categories

(Core :: Plug-ins, defect, minor)

defect
Not set
minor

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

Attachments

(1 file)

149 PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,

152     PluginScriptableObjectChild* actor;
153     NPError result = NPERR_NO_ERROR;

155     switch (aValue) {
156         case NPNVWindowNPObject:
168             break;

170         case NPNVPluginElementNPObject:
183             break;

185         default:
186             NS_NOTREACHED("Don't know what to do with this value type!");

215     if (result != NPERR_NO_ERROR) {
217     }

219     NPObject* object = actor->GetObject(false);
Attached patch failSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #435561 - Flags: review?(jst)
Comment on attachment 435561 [details] [diff] [review]
fail

Your patch can cause NPN_GetValue to return NPERR_INVALID_PARAM for an unknown param. This does not match in-process plugins or even the behavior of the calling function, which returns NPERR_GENERIC_ERROR for unknown variables. We should be consistent.

I think we should stick with our old behavior of returning NPERR_GENERIC_ERROR for unknown variables, so just change the error type in your patch to NPERR_GENERIC_ERROR.
Attachment #435561 - Flags: review?(jst) → review-
Hang on. We only call InternalGetNPObjectForValue from PluginInstanceChild::NPN_GetValue after we've check the NPNVariable, I think this bug is INVALID.
Resolving old bugs which are likely not relevant any more, since NPAPI plugins are deprecated.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.