summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-18 13:26:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-18 13:26:50 +0200
commite7e39d396913b002bdf9f76643f59108d849f392 (patch)
tree2eb5d8af3a8c78be842537c6221de8684279b2a0
parent6640136bd10a5704a85ec496cdbcd095656cf4a0 (diff)
Avoid undefined out-of-range conversions from double to unsigned char
Change-Id: I7cf4af81d477865aa0a93c8aa071a8785677c572
-rw-r--r--external/lpsolve/UnpackedTarball_lpsolve.mk1
-rw-r--r--external/lpsolve/lpsolve-ubsan.patch.011
2 files changed, 12 insertions, 0 deletions
diff --git a/external/lpsolve/UnpackedTarball_lpsolve.mk b/external/lpsolve/UnpackedTarball_lpsolve.mk
index 464fcab8a1ef..3d17c0e9b928 100644
--- a/external/lpsolve/UnpackedTarball_lpsolve.mk
+++ b/external/lpsolve/UnpackedTarball_lpsolve.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,lpsolve,\
external/lpsolve/lp_solve-aix.patch \
external/lpsolve/lp_solve-fixed-warn.patch \
external/lpsolve/lp_solve_5.5.patch \
+ external/lpsolve/lpsolve-ubsan.patch.0 \
))
$(eval $(call gb_UnpackedTarball_add_file,lpsolve,lpsolve55/ccc.static,external/lpsolve/ccc.static))
diff --git a/external/lpsolve/lpsolve-ubsan.patch.0 b/external/lpsolve/lpsolve-ubsan.patch.0
new file mode 100644
index 000000000000..29e9ad3b3c1a
--- /dev/null
+++ b/external/lpsolve/lpsolve-ubsan.patch.0
@@ -0,0 +1,11 @@
+--- lp_pricePSE.c
++++ lp_pricePSE.c
+@@ -145,7 +147,7 @@
+
+ /* Store the active/current pricing type */
+ if(isdual == AUTOMATIC)
+- isdual = (MYBOOL) lp->edgeVector[0];
++ isdual = lp->edgeVector[0] != 0.0;
+ else
+ lp->edgeVector[0] = isdual;
+