Add an exception handling on C Generator 17/194117/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 29 Nov 2018 07:05:02 +0000 (16:05 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 29 Nov 2018 07:05:02 +0000 (16:05 +0900)
Change-Id: I23b5f47df62cc5180f3bd12c7c729d5d840eba20
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
idlc/c_gen/c_proxy_body_gen_cb.h

index 95a8714..277ad2c 100644 (file)
@@ -266,10 +266,15 @@ R"__c_cb(
 static void __##_on_received(const char *endpoint, const char *port_name, void *data)
 {
     rpc_port_proxy_##_h handle = data;
-    rpc_port_parcel_h parcel_received;
+    rpc_port_parcel_h parcel_received = NULL;
     int cmd = -1;
 
     rpc_port_parcel_create_from_port(&parcel_received, handle->callback_port);
+    if (!parcel_received) {
+        _E("Failed to create parcel from port(%s)", port_name);
+        return;
+    }
+
     rpc_port_parcel_read_int32(parcel_received, &cmd);
     if (cmd != ##_METHOD_Callback) {
         _E("Invalid protocol");