From 060b2c5697e99a8613d5c9e16d1537abadbc31b8 Mon Sep 17 00:00:00 2001 From: David Raynor Date: Wed, 25 Feb 2015 23:16:53 +0100 Subject: [PATCH] s_fp_add: completely init c after add MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was reported in clamav via a "coverity report" #11125/#11126. I can't get the coverity report and I've been told that |< linnatic> bigeasy: unfortunately, I can't get you the coverity report |< linnatic> bigeasy: but it does seem that the patch is not |required as the possible coverity issue is unlikely to occur so if you thing that this patch is not required (which is what I assume) then please drop that patch, I just added since it was in the clamav treeā€¦ [sebastian@breakpoint: patch description] Signed-off-by: Sebastian Andrzej Siewior --- src/addsub/s_fp_add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addsub/s_fp_add.c b/src/addsub/s_fp_add.c index 4822be3..47406de 100644 --- a/src/addsub/s_fp_add.c +++ b/src/addsub/s_fp_add.c @@ -16,7 +16,7 @@ void s_fp_add(fp_int *a, fp_int *b, fp_int *c) register fp_word t; y = MAX(a->used, b->used); - oldused = c->used; + oldused = MIN(c->used, FP_SIZE); c->used = y; t = 0;