From: Changgyu Choi Date: Tue, 27 Dec 2022 09:16:27 +0000 (+0900) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/unified/20221228.170006~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bbcfc4906d682b0b9aa29373fb7d79f29d0bae0;p=platform%2Fcore%2Fbase%2Fbundle.git Fix static analysis issues Change-Id: Ifbe7aec3bfa0f14c28e90ad69c0bbefef2ef884c Signed-off-by: Changgyu Choi --- diff --git a/src/stub.cc b/src/stub.cc index 540ca4c..29e11e3 100644 --- a/src/stub.cc +++ b/src/stub.cc @@ -313,7 +313,13 @@ extern "C" EXPORT_API int bundle_encode(bundle *b, bundle_raw** raw, int* len) { return BUNDLE_ERROR_INVALID_PARAMETER; auto* h = reinterpret_cast(b); - *raw = reinterpret_cast(h->Encode()); + try { + *raw = reinterpret_cast(h->Encode()); + } catch (const Exception& e) { + *raw = nullptr; + return e.GetErrorCode(); + } + *len = strlen(reinterpret_cast(*raw)); return BUNDLE_ERROR_NONE; }