ofz#4303 fix another signed int overflow in boost (#996)

This commit is contained in:
David Tardon 2017-11-18 16:24:47 +01:00 committed by Abhishek Arya
parent 0a2b9c224c
commit 337187317e
2 changed files with 27 additions and 0 deletions

View File

@ -64,6 +64,7 @@ popd
tar -xjf $SRC/boost_1_65_1.tar.bz2
pushd boost_1_65_1
patch -p2 < $SRC/ofz2894.patch
patch -p2 < $SRC/ofz4303.patch
export CPPFLAGS="-I$(pwd)"
popd

View File

@ -0,0 +1,26 @@
From debdf8ce55d2d42c15bc99a09bd2c37c4c910630 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Sat, 18 Nov 2017 10:06:24 +0100
Subject: [PATCH] ofz#4303 avoid signed integer overflow
/usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:110:26: runtime error: signed integer overflow: -2147483647 - 19 cannot be represented in type 'int'
---
include/boost/spirit/home/qi/numeric/detail/real_impl.hpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp
index 3e7ab18a9..4a65bd79c 100644
--- a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp
+++ b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp
@@ -108,6 +108,8 @@ namespace boost { namespace spirit { namespace traits
inline bool
scale(int exp, int frac, T& n, AccT acc_n)
{
+ if (exp < std::numeric_limits<int>::min() + frac)
+ return false;
return scale(exp - frac, n, acc_n);
}
--
2.14.3