From a49dba08e6a1ab2d1714137fe5edc64ba6a40ef2 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Wed, 31 Jan 2018 22:55:02 +0100 Subject: [PATCH] Fix out-of-bounds error in multivar_diophant(). This could trigger an assertion in the factorization exams introduced in afb0ccaa49 if the library was compiled with -DDO_GINAC_ASSERT. --- ginac/factor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ginac/factor.cpp b/ginac/factor.cpp index 12e81a8d..aac6038a 100644 --- a/ginac/factor.cpp +++ b/ginac/factor.cpp @@ -1953,7 +1953,7 @@ static vector multivar_diophant(const vector& a_, const ex& x, const ex& delta_s[j] = delta_s[j] * modcm; sigma[j] = sigma[j] + umodpoly_to_ex(delta_s[j], x); } - if ( nterms > 1 ) { + if ( nterms > 1 && i+1 != nterms ) { z = c.op(i+1); } } -- 2.44.0