summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-15 11:50:47 +0100
committerMichael Stahl <mstahl@redhat.com>2013-08-15 13:28:38 +0000
commitd91469d6efe46cf4cccf0026b1cb9a1112c970b7 (patch)
treedc9c4ee9d3c03c018c887791446439970b506b74
parent651f3bfa7bc843e778c851e6cafc32e401c3890d (diff)
intermittent crash with failed empty response during update check
version1 is empty and version2 is not, so on second segment of version2 the i1 is already -1 from the first segment check -> kaboom (cherry picked from commit 3bb28b5aaef5e85a981dc9411db1f05524aeedf6) Change-Id: Ic19511a3b150f40d3cd9cf66bf9d86c94f3f9187 Reviewed-on: https://gerrit.libreoffice.org/5437 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--desktop/source/deployment/misc/dp_version.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop/source/deployment/misc/dp_version.cxx b/desktop/source/deployment/misc/dp_version.cxx
index 04b835515e3d..9cebfce3c8b0 100644
--- a/desktop/source/deployment/misc/dp_version.cxx
+++ b/desktop/source/deployment/misc/dp_version.cxx
@@ -43,8 +43,8 @@ namespace dp_misc {
::rtl::OUString const & version1, ::rtl::OUString const & version2)
{
for (::sal_Int32 i1 = 0, i2 = 0; i1 >= 0 || i2 >= 0;) {
- ::rtl::OUString e1(getElement(version1, &i1));
- ::rtl::OUString e2(getElement(version2, &i2));
+ ::rtl::OUString e1(i1 >= 0 ? getElement(version1, &i1) : ::rtl::OUString());
+ ::rtl::OUString e2(i2 >= 0 ? getElement(version2, &i2) : ::rtl::OUString());
if (e1.getLength() < e2.getLength()) {
return ::dp_misc::LESS;
} else if (e1.getLength() > e2.getLength()) {