Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[MXNET-953] Fix oob memory read
Browse files Browse the repository at this point in the history
  • Loading branch information
KellenSunderland committed Sep 25, 2018
1 parent 76ae725 commit afefecf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/operator/tensor/elemwise_unary_op_basic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +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();
memcpy(out_data.dptr_, &size_var, 1U * sizeof(int64_t));
*static_cast<int64_t*>(out_data.dptr_) = in_data.Size();
}

NNVM_REGISTER_OP(size_array)
Expand Down

0 comments on commit afefecf

Please sign in to comment.