To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=67612
Issue #|67612
Summary|coverity 139: Variable "pRestPath" tracked as NULL was
| passed to a function that dereferences it
Component|tools
Version|680m177
Platform|All
URL|
OS/Version|All
Status|NEW
Status whiteboard|
Keywords|
Resolution|
Issue type|PATCH
Priority|P3
Subcomponent|code
Assigned to|mh
Reported by|kendy
------- Additional comments from [EMAIL PROTECTED] Thu Jul 20 06:14:44 -0700
2006 -------
cosv/source/storage/dirchain.cxx:
63 void
64 DirectoryChain::Set( const char * i_sSubPath,
65 bool i_bPathIsAlwaysDir,
66 const char * i_sDelimiter )
67 {
68 const char * pRestPath = i_sSubPath;
Event var_compare_op: Added "pRestPath" due to comparison "pRestPath != 0"
Also see events: [var_deref_model]
At conditional (1): "pRestPath != 0" taking false path
At conditional (2): "((pRestPath != 0) ? ((*pRestPath == *i_sDelimiter) ? 1 :
(0)) : (0)) != 0" taking false path
69 if ( pRestPath != 0 ? *pRestPath == *i_sDelimiter : false )
70 ++pRestPath;
71
Event var_deref_model: Variable "pRestPath" tracked as NULL was passed to a
function that dereferences it.
Also see events: [var_compare_op]
72 for ( const char * pDirEnd = strchr(pRestPath,*i_sDelimiter);
73 pDirEnd != 0;
74 pDirEnd = strchr(pRestPath,*i_sDelimiter) )
75 {
76 aPath.push_back( String(pRestPath, pDirEnd - pRestPath) );
77 pRestPath = pDirEnd + 1;
78 }
79 if (*pRestPath != 0 AND i_bPathIsAlwaysDir)
80 aPath.push_back( String(pRestPath) );
81 }
It would make sense to check i_sSubPath for NULL at the beginning of the
function, and return if that's the case. (Also - lines 69-70 are an ugly piece
of code; as well as the '#define AND &&' in cosv/inc/cosv/csv_env.hxx - but
that does not matter that much I guess).
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]