From a2e0742e77e63c35f2b1c3680ad55b2716e0e5c3 Mon Sep 17 00:00:00 2001 From: fengj130406 Date: Tue, 4 Mar 2025 21:17:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E9=97=AE=E9=A2=98=E6=B8=85?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fengj130406 --- interfaces/innerkits/src/bundle_active_event.cpp | 3 +++ interfaces/innerkits/src/bundle_active_event_stats.cpp | 3 +++ interfaces/innerkits/src/bundle_active_form_record.cpp | 3 +++ interfaces/innerkits/src/bundle_active_package_stats.cpp | 3 +++ 4 files changed, 12 insertions(+) diff --git a/interfaces/innerkits/src/bundle_active_event.cpp b/interfaces/innerkits/src/bundle_active_event.cpp index 3983c8a..3b1fd73 100644 --- a/interfaces/innerkits/src/bundle_active_event.cpp +++ b/interfaces/innerkits/src/bundle_active_event.cpp @@ -176,6 +176,9 @@ bool BundleActiveEvent::Marshalling(Parcel &parcel) const BundleActiveEvent *BundleActiveEvent::Unmarshalling(Parcel &parcel) { BundleActiveEvent *result = new (std::nothrow) BundleActiveEvent(); + if (result == nullptr) { + return nullptr; + } result->bundleName_ = parcel.ReadString(); result->continuousTaskAbilityName_ = parcel.ReadString(); result->abilityName_ = parcel.ReadString(); diff --git a/interfaces/innerkits/src/bundle_active_event_stats.cpp b/interfaces/innerkits/src/bundle_active_event_stats.cpp index 4850e17..2c9531b 100644 --- a/interfaces/innerkits/src/bundle_active_event_stats.cpp +++ b/interfaces/innerkits/src/bundle_active_event_stats.cpp @@ -105,6 +105,9 @@ bool BundleActiveEventStats::Marshalling(Parcel &parcel) const BundleActiveEventStats *BundleActiveEventStats::Unmarshalling(Parcel &parcel) { BundleActiveEventStats *result = new (std::nothrow) BundleActiveEventStats(); + if (result == nullptr) { + return nullptr; + } result->eventId_ = parcel.ReadInt32(); result->beginTimeStamp_ = parcel.ReadInt64(); result->endTimeStamp_ = parcel.ReadInt64(); diff --git a/interfaces/innerkits/src/bundle_active_form_record.cpp b/interfaces/innerkits/src/bundle_active_form_record.cpp index 15bf981..ce1c74d 100644 --- a/interfaces/innerkits/src/bundle_active_form_record.cpp +++ b/interfaces/innerkits/src/bundle_active_form_record.cpp @@ -74,6 +74,9 @@ bool BundleActiveFormRecord::Marshalling(Parcel &parcel) const BundleActiveFormRecord *BundleActiveFormRecord::Unmarshalling(Parcel &parcel) { BundleActiveFormRecord *result = new (std::nothrow) BundleActiveFormRecord(); + if (result == nullptr) { + return nullptr; + } result->formName_ = parcel.ReadString(); result->formDimension_ = parcel.ReadInt32(); result->formId_ = parcel.ReadInt64(); diff --git a/interfaces/innerkits/src/bundle_active_package_stats.cpp b/interfaces/innerkits/src/bundle_active_package_stats.cpp index c5f6e35..551429b 100644 --- a/interfaces/innerkits/src/bundle_active_package_stats.cpp +++ b/interfaces/innerkits/src/bundle_active_package_stats.cpp @@ -227,6 +227,9 @@ bool BundleActivePackageStats::Marshalling(Parcel &parcel) const BundleActivePackageStats *BundleActivePackageStats::Unmarshalling(Parcel &parcel) { BundleActivePackageStats *result = new (std::nothrow) BundleActivePackageStats(); + if (result == nullptr) { + return nullptr; + } result->bundleName_ = parcel.ReadString(); result->beginTimeStamp_ = parcel.ReadInt64(); result->lastTimeUsed_ = parcel.ReadInt64(); -- Gitee