From 3d99fb9a8785e3c58088bad60aa664e3446f8234 Mon Sep 17 00:00:00 2001 From: Fred Gleason <fredg@paraelsystems.com> Date: Sat, 11 Aug 2018 22:14:00 +0000 Subject: [PATCH] 2018-08-11 Fred Gleason <fredg@paravelsystems.com> * Fixed a bug in rddbmgr(8) that could cause segfaults when determining the current schema verion. --- ChangeLog | 3 +++ utils/rddbmgr/schemamap.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2acafc88..1b05aa9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17362,3 +17362,6 @@ 2018-08-11 Fred Gleason <fredg@paravelsystems.com> * Added a rule to remove stale moc(1) files in 'web/webget/Makefile.am'. +2018-08-11 Fred Gleason <fredg@paravelsystems.com> + * Fixed a bug in rddbmgr(8) that could cause segfaults when + determining the current schema verion. diff --git a/utils/rddbmgr/schemamap.cpp b/utils/rddbmgr/schemamap.cpp index 492e21f1..6f97d1da 100644 --- a/utils/rddbmgr/schemamap.cpp +++ b/utils/rddbmgr/schemamap.cpp @@ -54,8 +54,12 @@ VersionString::VersionString(const char *str) { QStringList f0=f0.split(".",str); ver_major=f0[0].toInt(); - ver_minor=f0[1].toInt(); - ver_point=f0[2].toInt(); + if(f0.size()>=2) { + ver_minor=f0[1].toInt(); + if(f0.size()>=3) { + ver_point=f0[2].toInt(); + } + } }