KellenSunderland commented on a change in pull request #12631: [MXNET-953] Fix 
oob memory read
URL: https://github.com/apache/incubator-mxnet/pull/12631#discussion_r220067915
 
 

 ##########
 File path: src/operator/tensor/elemwise_unary_op_basic.cc
 ##########
 @@ -542,7 +542,7 @@ void SizeComputeCPU(const nnvm::NodeAttrs& attrs,
   CHECK_EQ(req.size(), 1U);
   const TBlob& in_data = inputs[0];
   const TBlob& out_data = outputs[0];
-  const index_t size_var = in_data.Size();
+  const int64_t size_var = in_data.Size();
   memcpy(out_data.dptr_, &size_var, 1U * sizeof(int64_t));
 
 Review comment:
   Yeah I agree, better to cast the pointer and then assign.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to