summaryrefslogtreecommitdiff
path: root/harmony/curl/curl-do-bounds-check-using-a-double-comparison.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
commit7553795ec2d735c01dbdde129a65b7f45d5aa999 (patch)
treeb3970009a8246b0c17a105fe6b10c8077fc2b763 /harmony/curl/curl-do-bounds-check-using-a-double-comparison.patch
parente2b01859c88d221992403d1293d42da33002be4d (diff)
downloadpackages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.gz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.bz2
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.xz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.zip
Add harmony/ repo for packages still being discussed
See https://wiki.adelielinux.org/wiki/Project:Harmony
Diffstat (limited to 'harmony/curl/curl-do-bounds-check-using-a-double-comparison.patch')
-rw-r--r--harmony/curl/curl-do-bounds-check-using-a-double-comparison.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/harmony/curl/curl-do-bounds-check-using-a-double-comparison.patch b/harmony/curl/curl-do-bounds-check-using-a-double-comparison.patch
new file mode 100644
index 000000000..34e2b6c71
--- /dev/null
+++ b/harmony/curl/curl-do-bounds-check-using-a-double-comparison.patch
@@ -0,0 +1,32 @@
+From 45a560390c4356bcb81d933bbbb229c8ea2acb63 Mon Sep 17 00:00:00 2001
+From: Adam Sampson <ats@offog.org>
+Date: Wed, 9 Aug 2017 14:11:17 +0100
+Subject: [PATCH] curl: do bounds check using a double comparison
+
+The fix for this in 8661a0aacc01492e0436275ff36a21734f2541bb wasn't
+complete: if the parsed number in num is larger than will fit in a long,
+the conversion is undefined behaviour (causing test1427 to fail for me
+on IA32 with GCC 7.1, although it passes on AMD64 and ARMv7). Getting
+rid of the cast means the comparison will be done using doubles.
+
+It might make more sense for the max argument to also be a double...
+
+Fixes #1750
+Closes #1749
+---
+ src/tool_paramhlp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c
+index b9dedc989e..85c5e79a7e 100644
+--- a/src/tool_paramhlp.c
++++ b/src/tool_paramhlp.c
+@@ -218,7 +218,7 @@ static ParameterError str2double(double *val, const char *str, long max)
+ num = strtod(str, &endptr);
+ if(errno == ERANGE)
+ return PARAM_NUMBER_TOO_LARGE;
+- if((long)num > max) {
++ if(num > max) {
+ /* too large */
+ return PARAM_NUMBER_TOO_LARGE;
+ }