Kaydet (Commit) 396eb4f5 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud Kaydeden (comit) Caolán McNamara

coverity#440141 Null Dereference

Change-Id: Ifdbfecdb5443024f7186882cf09d8fba998e94f2
Reviewed-on: https://gerrit.libreoffice.org/2213Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e70defef
...@@ -543,23 +543,19 @@ int ...@@ -543,23 +543,19 @@ int
HF_IdlTypeText::count_Sequences( const char * i_sFullType ) const HF_IdlTypeText::count_Sequences( const char * i_sFullType ) const
{ {
int ret = 0; int ret = 0;
const char* pCount = i_sFullType;
for ( const char * pCount = i_sFullType; while((pCount = strstr(pCount,"sequence")) != 0)
*pCount != 0;
)
{ {
pCount = strstr(pCount,"sequence");
if (pCount != 0) pCount += sizeof("sequence"); // = strlen(sequence) + 1 for '<'.
if ( *(pCount-1) == '\0' )
{ {
pCount += sizeof("sequence"); // = strlen(sequence) + 1 for '<'. // SYNTAX_ERR
if ( *(pCount-1) == '\0' ) return 0;
{
// SYNTAX_ERR
return 0;
}
++ret;
} }
} // end for ret += 1;
}
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment