From e04d7c49dca9dc7bbf1cbe446b612aaa5ba12581 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 14 Jan 2018 22:14:20 +0100 Subject: Fix buffer overflow vulnerabilities in mesh code. Solves these security issues from T52924: CVE-2017-12081 CVE-2017-12082 CVE-2017-12086 CVE-2017-12099 CVE-2017-12100 CVE-2017-12101 CVE-2017-12105 While the specific overflow issue may be fixed, loading the repro .blend files may still crash because they are incomplete and corrupt. The way they crash may be impossible to exploit, but this is difficult to prove. Differential Revision: https://developer.blender.org/D3002 --- source/blender/modifiers/intern/MOD_laplaciansmooth.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_laplaciansmooth.c') diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c index f1216ff462a..b3a542f68b7 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c @@ -132,14 +132,14 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numPolys, in sys->numLoops = a_numLoops; sys->numVerts = a_numVerts; - sys->eweights = MEM_callocN(sizeof(float) * sys->numEdges, __func__); - sys->fweights = MEM_callocN(sizeof(float[3]) * sys->numLoops, __func__); - sys->numNeEd = MEM_callocN(sizeof(short) * sys->numVerts, __func__); - sys->numNeFa = MEM_callocN(sizeof(short) * sys->numVerts, __func__); - sys->ring_areas = MEM_callocN(sizeof(float) * sys->numVerts, __func__); - sys->vlengths = MEM_callocN(sizeof(float) * sys->numVerts, __func__); - sys->vweights = MEM_callocN(sizeof(float) * sys->numVerts, __func__); - sys->zerola = MEM_callocN(sizeof(short) * sys->numVerts, __func__); + sys->eweights = MEM_calloc_arrayN(sys->numEdges, sizeof(float), __func__); + sys->fweights = MEM_calloc_arrayN(sys->numLoops, sizeof(float[3]), __func__); + sys->numNeEd = MEM_calloc_arrayN(sys->numVerts, sizeof(short), __func__); + sys->numNeFa = MEM_calloc_arrayN(sys->numVerts, sizeof(short), __func__); + sys->ring_areas = MEM_calloc_arrayN(sys->numVerts, sizeof(float), __func__); + sys->vlengths = MEM_calloc_arrayN(sys->numVerts, sizeof(float), __func__); + sys->vweights = MEM_calloc_arrayN(sys->numVerts, sizeof(float), __func__); + sys->zerola = MEM_calloc_arrayN(sys->numVerts, sizeof(short), __func__); return sys; } -- cgit v1.2.3