diff options
author | Luật Nguyễn <manhluat93.php@gmail.com> | 2017-10-10 12:39:22 +0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-10 20:12:46 +0000 |
commit | 1886471c3432dee4d9a9be5678a757dde8717652 (patch) | |
tree | 437dd29735be2351e475819798e40edddf41b50b /fpdfsdk/formfiller/cffl_textfield.cpp | |
parent | dd002931a16a99b0c6e6ae7b6cba9d4dafb27e18 (diff) | |
download | pdfium-1886471c3432dee4d9a9be5678a757dde8717652.tar.xz |
Fix UAF in SaveData on all of CFFL_* types.
Bug: 756427
Change-Id: I8e31d96c6f3b83a6464ed69c95225362c50386d1
Reviewed-on: https://pdfium-review.googlesource.com/15870
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_textfield.cpp')
-rw-r--r-- | fpdfsdk/formfiller/cffl_textfield.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp index 4174ae4179..ad8d27c916 100644 --- a/fpdfsdk/formfiller/cffl_textfield.cpp +++ b/fpdfsdk/formfiller/cffl_textfield.cpp @@ -141,13 +141,17 @@ void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView) { CPDFSDK_Widget::ObservedPtr observed_widget(m_pWidget.Get()); CFFL_TextField::ObservedPtr observed_this(this); + m_pWidget->SetValue(sNewValue, false); - if (observed_widget) - m_pWidget->ResetFieldAppearance(true); - if (observed_widget) - m_pWidget->UpdateField(); - if (observed_this) - SetChangeMark(); + if (!observed_widget) + return; + m_pWidget->ResetFieldAppearance(true); + if (!observed_widget) + return; + m_pWidget->UpdateField(); + if (!observed_widget || !observed_this) + return; + SetChangeMark(); } void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, |