summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/nasm/nasm/0001-fix-CVE-2018-8882.patch
blob: bc706c3f152c8749d9d5df997ba24c0536e10fb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 33438037e00ec750bff020578b1a5b6f75f60555 Mon Sep 17 00:00:00 2001
From: Adam Majer <amajer@suse.de>
Date: Fri, 17 Aug 2018 14:41:02 +0800
Subject: [PATCH] fix CVE-2018-8882

https://bugzilla.nasm.us/show_bug.cgi?id=3392445

Upstream-Status: Submitted [https://bugzilla.nasm.us/show_bug.cgi?id=3392445]
CVE: CVE-2018-8882
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 asm/float.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/asm/float.c b/asm/float.c
index dcf69fea..2965d3db 100644
--- a/asm/float.c
+++ b/asm/float.c
@@ -608,6 +608,8 @@ static void ieee_shr(fp_limb *mant, int i)
         if (offs)
             for (j = MANT_LIMBS-1; j >= offs; j--)
                 mant[j] = mant[j-offs];
+    } else if (MANT_LIMBS-1-offs < 0) {
+        j = MANT_LIMBS-1;
     } else {
         n = mant[MANT_LIMBS-1-offs] >> sr;
         for (j = MANT_LIMBS-1; j > offs; j--) {
-- 
2.17.1