From 69b312d13bcff1743b5954c191292863fd1ec42c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 6 Sep 2019 12:14:22 +0200 Subject: [PATCH] Fix coverity issue: memory corruption due to overlapping copy. --- jsvalue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsvalue.c b/jsvalue.c index 45abb70..a97dea3 100644 --- a/jsvalue.c +++ b/jsvalue.c @@ -592,12 +592,12 @@ retry: if (x->type == JS_TBOOLEAN) { x->type = JS_TNUMBER; - x->u.number = x->u.boolean; + x->u.number = x->u.boolean ? 1 : 0; goto retry; } if (y->type == JS_TBOOLEAN) { y->type = JS_TNUMBER; - y->u.number = y->u.boolean; + y->u.number = y->u.boolean ? 1 : 0; goto retry; } if ((JSV_ISSTRING(x) || x->type == JS_TNUMBER) && y->type == JS_TOBJECT) {