Closed Bug 1208856 Opened 6 years ago Closed 6 years ago

Possible bad null-check in sdnAccessible::get_computedStyle()

Categories

(Core :: Disability Access APIs, defect)

44 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1208900
Tracking Status
firefox44 --- affected

People

(Reporter: ssitter, Unassigned)

References

Details

(Whiteboard: [pvs-studio])

From "Static Analysis of Mozilla Thunderbird's Code by PVS-Studio" <http://www.viva64.com/en/b/0347/>:

PVS-Studio's diagnostic message: V522 Dereferencing of the null pointer 'aStyleValues' might take place. sdnaccessible.cpp 252

STDMETHODIMP sdnAccessible::get_computedStyle(
                   BSTR __RPC_FAR* aStyleProperties,
                   BSTR __RPC_FAR* aStyleValues,
                   unsigned short __RPC_FAR* aNumStyleProperties)
{
  if (!aStyleProperties || aStyleValues || !aNumStyleProperties)
    return E_INVALIDARG;
  ....
  aStyleValues[realIndex] = ::SysAllocString(value.get());
  ....
}

Find the rogue.

The analyzer has detected a null pointer dereferencing issue. When implementing the check, the programmer forgot to add "!" before "aStyleValues". The subsequent code gets control only when this pointer equals zero, and dereferences it.
Blocks: 710966
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1208900
You need to log in before you can comment on or make changes to this bug.