Skip to content

Commit 687fb40

Browse files
authored
Merge pull request #15759 from liuwei1031/release/1.3
merge security issue fix test=release/1.3
2 parents 745f88b + f20c887 commit 687fb40

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

paddle/fluid/framework/ir/infer_clean_graph_pass.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class InferCleanGraphPass : public FusePassBase {
3737
std::unordered_set<const Node*> invalid_nodes;
3838
int valid_op = 0;
3939
for (auto* node : graph->Nodes()) {
40+
PADDLE_ENFORCE_NOT_NULL(node);
4041
if (is_valid_node(node)) {
4142
invalid_nodes.insert(node);
4243
} else if (node->IsOp()) {

paddle/fluid/operators/lstm_op.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ class LSTMGradKernel : public framework::OpKernel<T> {
311311
lstm_grad.prev_state_grad = c0_g ? ordered_c0_g.data<T>() : nullptr;
312312
}
313313

314+
// lstm_value.output_value not used in bp, set to nullptr
315+
// lstm_grad.state_active_grad not used in bp, set to nullptr
316+
lstm_value.output_value = nullptr;
317+
lstm_grad.state_active_grad = nullptr;
314318
int cur_batch_size = bend - bstart;
315319
math::LstmUnitGradFunctor<DeviceContext, T>::compute(
316320
device_ctx, lstm_value, lstm_grad, frame_size, cur_batch_size,

paddle/fluid/operators/lstmp_op.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ class LSTMPGradKernel : public framework::OpKernel<T> {
405405
}
406406

407407
int cur_batch_size = bend - bstart;
408+
// lstmp_value.output_value not used in bp, set to null
409+
// lstmp_grad.state_active_grad not used in bp, set to null
410+
lstmp_value.output_value = nullptr;
411+
lstmp_grad.state_active_grad = nullptr;
412+
408413
math::LstmUnitGradFunctor<DeviceContext, T>::compute(
409414
device_ctx, lstmp_value, lstmp_grad, frame_size, cur_batch_size,
410415
gate_act, cell_act, cand_act);

paddle/fluid/operators/random_crop_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ struct RandomCropFunctor {
121121
HOSTDEVICE void operator()(size_t ins_idx) {
122122
typename Random<DeviceContext>::Engine engine(seed_);
123123
engine.discard(ins_idx * (rank_ - num_batchsize_dims_));
124-
size_t offsets[9];
124+
size_t offsets[9] = {};
125125
for (int i = num_batchsize_dims_; i < rank_; ++i) {
126126
typename Random<DeviceContext>::template UniformIntDist<size_t> dist(
127127
0, x_dims_[i] - out_dims_[i]);

0 commit comments

Comments
 (0)