diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-06 15:24:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-06 15:29:14 +0000 |
commit | 8c0bb201382d839124fb9a9c8906e2c2018a6939 (patch) | |
tree | 36314dc4536bef15f3edf1d214e14e50e7b57dfe /sc | |
parent | 894a3598371c812604832bb1b698ede58cae4427 (diff) |
avoid out of bounds string access
Change-Id: I0a0affea08528fc9bd729ab01cdb5fa6e9f8e18f
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/optdlg/tpusrlst.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 2b986ce09c9d..89c9d19c930b 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -333,14 +333,14 @@ void ScTpUserLists::MakeListStr( OUString& rListStr ) while ( c < nLen ) { rListStr += OUString(aStr[c]); - c++; + ++c; - if ( aStr[c] == cDelimiter ) + if ((c < nLen) && (aStr[c] == cDelimiter)) { rListStr += OUString(aStr[c]); - while ( (c < nLen) && (aStr[c] == cDelimiter) ) - c++; + while ((c < nLen) && (aStr[c] == cDelimiter)) + ++c; } } |