Skip to content

Commit 37d7c84

Browse files
committed
Fix UBSAN issues in lp_solve
1 parent 5ec57dd commit 37d7c84

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

R-proj/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Description: Provides an R interface for 'volesti' C++ package. 'volesti' comput
1212
for sampling, rounding and rotating polytopes. Moreover, 'volesti' provides algorithms for
1313
estimating copulas useful in computational finance. Methods implemented in 'volesti' are described
1414
in A. Chalkis and V. Fisikopoulos (2022) <doi:10.32614/RJ-2021-077> and references therein.
15-
Version: 1.1.2-4
16-
Date: 2022-04-03
15+
Version: 1.1.2-6
16+
Date: 2023-04-11
1717
Maintainer: Vissarion Fisikopoulos <[email protected]>
1818
Depends: Rcpp (>= 0.12.17)
1919
Imports: methods, stats

R-proj/src/Rproj_externals/lp_solve/lp_presolve.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
initial version of column aggregation code.
3333
------------------------------------------------------------------------- */
3434

35-
//Modified by Apostolos Chalkis in May of 2020.
36-
3735
#include <string.h>
3836
#include "commonlib.h"
3937
#include "lp_lib.h"
@@ -170,13 +168,17 @@ STATIC MYBOOL presolve_rebuildUndo(lprec *lp, MYBOOL isprimal)
170168
if(isprimal) {
171169
if(psdata->primalundo != NULL)
172170
mat = psdata->primalundo->tracker;
173-
solution = lp->full_solution + lp->presolve_undo->orig_rows; // Comment out by Apostolos Chalkis
171+
if(mat == NULL)
172+
return( FALSE );
173+
solution = lp->full_solution + lp->presolve_undo->orig_rows;
174174
slacks = lp->full_solution;
175175
}
176176
else {
177177
if(psdata->dualundo != NULL)
178178
mat = psdata->dualundo->tracker;
179-
solution = lp->full_duals; // Comment out by Apostolos Chalkis
179+
if(mat == NULL)
180+
return( FALSE );
181+
solution = lp->full_duals;
180182
slacks = lp->full_duals + lp->presolve_undo->orig_rows;
181183
}
182184
if(mat == NULL)

cran_gen/Makevars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PKG_CPPFLAGS=-Iexternal -Iexternal/lpsolve/headers/run_headers -Iexternal/minimum_ellipsoid -Iinclude -Iinclude/convex_bodies/spectrahedra
22
PKG_CXXFLAGS= -DBOOST_NO_AUTO_PTR
3-
CXX_STD = CXX11
43

54
PKG_LIBS=-Lexternal/lpsolve/build/lp_solve -llp_solve $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
65

cran_gen/Makevars.win

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PKG_CPPFLAGS=-Iexternal -Iexternal/lpsolve/headers/run_headers -Iexternal/minimum_ellipsoid -Iinclude -Iinclude/convex_bodies/spectrahedra
22
PKG_CXXFLAGS= -lm -ldl -DBOOST_NO_AUTO_PTR
3-
CXX_STD = CXX11
43

54
PKG_LIBS=-Lexternal/lpsolve/build/lp_solve -llp_solve $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
65

cran_gen/NEWS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,8 @@
4545

4646
# volesti 1.1.2-4
4747

48-
- Remove uninitialized warning in clang-16 (lp_presolve)
48+
- Remove uninitialized warning in clang-16 (lp_presolve)
49+
50+
# volesti 1.1.2-6
51+
52+
- Fix UBSAN issues (lp_presolve)

0 commit comments

Comments
 (0)