Fix segfault on basic operations

epel9
Mukundan Ragavan 7 years ago
parent e0f936a44a
commit bdfaa30395

@ -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++;

@ -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 <nonamedotc@fedoraproject.org> - 2.5.0-2
- Fix segfault on basic operations
* Wed May 16 2018 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 2.5.0-1
- Update to 2.5.0

Loading…
Cancel
Save