Issue 101952 - sw: ambiguous && || has possibility to deference NULL
Summary: sw: ambiguous && || has possibility to deference NULL
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: DEV300m48
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: Oliver Specht
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2009-05-15 10:50 UTC by caolanm
Modified: 2013-08-07 14:44 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch to fix (1.01 KB, patch)
2009-05-15 10:50 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2009-05-15 10:50:01 UTC
in source/core/crsr/pam.cxx we have...

if( pNd &&
     ( ... ) ||
     ( !bInReadOnly && pNd->FindSectionNode() &&
       pNd->FindSectionNode()->GetSection().IsProtect() ))
{
}

i.e. by precedence that's

if( (pNd && ( ... )) ||
     ( !bInReadOnly && pNd->FindSectionNode() &&
       pNd->FindSectionNode()->GetSection().IsProtect() ))
{
}

so if pNd == NULL then pNd can be dereferenced after the || which is
presumably not what's intended. More than likely the logic if the following
patch is intended
Comment 1 caolanm 2009-05-15 10:50:24 UTC
Created attachment 62289 [details]
patch to fix
Comment 2 andreas.martens 2009-05-18 07:32:50 UTC
ama->os: cmc did it again ;-) a fix for Writer...
Comment 3 Oliver Specht 2009-05-18 08:14:33 UTC
Integrated in cws os130
Comment 4 Oliver Specht 2009-05-19 13:50:29 UTC
Set to verified. No testcase for a crash available.
Comment 5 caolanm 2010-07-16 10:26:34 UTC
closing, integrated DEV300m52