diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-02-18 00:47:58 -0600 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-02-19 14:16:31 +0000 |
commit | 396eb4f5cf8b37cd2a9f14d85764e03761ade19f (patch) | |
tree | 55386ec5216db9942bb51d7dc6fadc7e2413a24d /autodoc | |
parent | e70defefd80c44646a742ff581bca9b467b8e713 (diff) |
coverity#440141 Null Dereference
Change-Id: Ifdbfecdb5443024f7186882cf09d8fba998e94f2
Reviewed-on: https://gerrit.libreoffice.org/2213
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'autodoc')
-rw-r--r-- | autodoc/source/display/idl/hfi_typetext.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/autodoc/source/display/idl/hfi_typetext.cxx b/autodoc/source/display/idl/hfi_typetext.cxx index a100066f3195..03c4b263a436 100644 --- a/autodoc/source/display/idl/hfi_typetext.cxx +++ b/autodoc/source/display/idl/hfi_typetext.cxx @@ -543,23 +543,19 @@ int HF_IdlTypeText::count_Sequences( const char * i_sFullType ) const { int ret = 0; + const char* pCount = i_sFullType; - for ( const char * pCount = i_sFullType; - *pCount != 0; - ) + while((pCount = strstr(pCount,"sequence")) != 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 '<'. - if ( *(pCount-1) == '\0' ) - { - // SYNTAX_ERR - return 0; - } - ++ret; + // SYNTAX_ERR + return 0; } - } // end for + ret += 1; + } return ret; } |