From 966888844b9205ffff172c2f41119a926bd41641 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 25 Oct 2020 05:51:44 +0000 Subject: [PATCH] fixed an object protection mistake in hcl_divints() --- lib/bigint.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/bigint.c b/lib/bigint.c index 06e3420..69e936a 100644 --- a/lib/bigint.c +++ b/lib/bigint.c @@ -2804,8 +2804,12 @@ hcl_oop_t hcl_divints (hcl_t* hcl, hcl_oop_t x, hcl_oop_t y, int modulo, hcl_oop if (!r) return HCL_NULL; } - if (rem) *rem = r; - return normalize_bigint (hcl, z); + hcl_pushtmp (hcl, &r); + z = normalize_bigint(hcl, z); + hcl_poptmp (hcl); + + if (z && rem) *rem = r; + return z; oops_einval: hcl_seterrbfmt (hcl, HCL_EINVAL, "parameter not integer - %O, %O", x, y);