diff --git a/libqalculate-2.5.0_fix_segfault.patch b/libqalculate-2.5.0_fix_segfault.patch new file mode 100644 index 0000000..7a1f545 --- /dev/null +++ b/libqalculate-2.5.0_fix_segfault.patch @@ -0,0 +1,20 @@ +--- libqalculate/Calculator.cc.orig 2018-05-15 00:14:33.000000000 -0400 ++++ libqalculate/Calculator.cc 2018-05-18 18:05:14.646690898 -0400 +@@ -5537,7 +5537,7 @@ + return true; + } + if((i = str.find_first_of(LESS GREATER EQUALS NOT, 0)) != string::npos) { +- while((i != string::npos && (str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH)) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH)) { ++ while(i != string::npos && ((str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH))) { + i = str.find_first_of(LESS GREATER NOT EQUALS, i + 2); + } + } +@@ -5552,7 +5552,7 @@ + } + MathOperation s = OPERATION_ADD; + while(!c) { +- while((i != string::npos && (str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH)) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH)) { ++ while(i != string::npos && ((str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH))) { + i = str.find_first_of(LESS GREATER NOT EQUALS, i + 2); + while(i != string::npos && str[i] == NOT_CH && str.length() > i + 1 && str[i + 1] == NOT_CH) { + i++; diff --git a/libqalculate.spec b/libqalculate.spec index 29213db..53fa521 100644 --- a/libqalculate.spec +++ b/libqalculate.spec @@ -3,11 +3,12 @@ Summary: Multi-purpose calculator library Name: libqalculate Version: 2.5.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://qalculate.github.io/ Source0: https://github.com/%{srcnm}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz +Patch0: %{name}-%{version}_fix_segfault.patch BuildRequires: gcc-c++ BuildRequires: glib2-devel @@ -82,6 +83,9 @@ rm -f %{buildroot}/%{_libdir}/*.la %{_bindir}/qalc %changelog +* Fri May 18 2018 Mukundan Ragavan - 2.5.0-2 +- Fix segfault on basic operations + * Wed May 16 2018 Mukundan Ragavan - 2.5.0-1 - Update to 2.5.0