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
|
Description: Fix stack smashing crash in *gemmBatch
Calling ARRAY_INIT more than 3 times without resetting num_ev
runs off the end of evl.
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: https://github.com/Theano/libgpuarray/pull/584
--- a/src/gpuarray_blas_opencl_clblas.c
+++ b/src/gpuarray_blas_opencl_clblas.c
@@ -136,6 +136,7 @@ static int sgemmBatch(cb_order order, cb
cl_uint num_ev = 0;
for (i = 0; i < batchCount; i++) {
+ num_ev = 0;
ARRAY_INIT(A[i]);
ARRAY_INIT(B[i]);
ARRAY_INIT(C[i]);
@@ -167,6 +168,7 @@ static int dgemmBatch(cb_order order, cb
cl_uint num_ev = 0;
for (i = 0; i < batchCount; i++) {
+ num_ev = 0;
ARRAY_INIT(A[i]);
ARRAY_INIT(B[i]);
ARRAY_INIT(C[i]);
|