fix heap-buffer-overflow in paddle frontend (#23599)

### Details:
 - *fix heap-buffer-overflow in paddle frontend*

### Tickets:
 - *CVS-135869*
This commit is contained in:
mei, yang 2024-03-24 23:17:32 +08:00 committed by GitHub
parent a9b918a280
commit e274ac6a1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -451,7 +451,10 @@ void InputModel::InputModelImpl::createTempConsts() {
}
if (tensor_ps.is_static()) {
shape[1] = 0;
// this tensorarray tensor originally could be scalar, then
// tensor_ps size would be 1 after unsqueeze.
auto idx = tensor_ps.size() > 1 ? 1 : 0;
shape[idx] = 0;
}
auto node = opset7::Constant::create(type, shape, {0});