Closed Bug 1274138 Opened 8 years ago Closed 6 years ago

Use a more type safe hash table in nsNSSShutDown.{h,cpp} to avoid casts

Categories

(Core :: Security: PSM, defect, P5)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1417680

People

(Reporter: Cykesiopka, Unassigned)

References

()

Details

(Whiteboard: [psm-cleanup])

(David Keeler [:keeler] (use needinfo?) from Bug 1271501 comment #8)
> ::: security/manager/ssl/nsNSSShutDown.cpp:119
> (Diff revision 1)
> >    for (auto iter = singleton->mPK11LogoutCancelObjects.Iter();
> >         !iter.Done();
> >         iter.Next()) {
> >      auto entry = static_cast<ObjectHashEntry*>(iter.Get());
> > -    nsOnPK11LogoutCancelObject *pklco =
> > -      reinterpret_cast<nsOnPK11LogoutCancelObject*>(entry->obj);
> > +    nsOnPK11LogoutCancelObject* pklco =
> > +      BitwiseCast<nsOnPK11LogoutCancelObject*, nsNSSShutDownObject*>(entry->obj);
> 
> This actually seems like a bad situation we should fix (in a follow-up). I'm
> sure we can use a higher-level hash table that's parameterized or something.

Indeed. It looks like one of the hash table classes under xpcom/glue/ will work.
We can probably just wontfix this when we remove the shutdown machinery altogether.
Priority: -- → P5
Hopefully bug 1417680 will obviate this.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.