Fix coverity issue - Unchecked dynamic-cast 20/182820/2
authorhuiyu.eun <huiyu.eun@samsung.com>
Thu, 28 Jun 2018 07:10:52 +0000 (16:10 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Thu, 28 Jun 2018 07:53:24 +0000 (16:53 +0900)
Change-Id: Ic51f9d1f49cd699deb81aa63ec6f56cc2ddc91d6
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
dali-csharp-binder/src/layout-group-wrapper-impl.cpp
dali-csharp-binder/src/layout-item-wrapper-impl.cpp
dali-csharp-binder/src/layout-length.cpp

index 1784345..5e3a712 100755 (executable)
@@ -701,6 +701,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_DoInitialize(void
 
   arg1 = (Dali::Toolkit::Internal::LayoutGroup *)jarg1;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->DoInitialize();
@@ -727,6 +732,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_DoInitializeSwigE
 
   arg1 = (Dali::Toolkit::Internal::LayoutGroup *)jarg1;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->DoInitializeSwigPublic();
@@ -760,6 +770,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_DoRegisterChildPr
   std::string arg2_str(jarg2);
   arg2 = &arg2_str;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->DoRegisterChildProperties((std::string const &)*arg2);
@@ -796,6 +811,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_DoRegisterChildPr
   std::string arg2_str(jarg2);
   arg2 = &arg2_str;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->DoRegisterChildPropertiesSwigPublic((std::string const &)*arg2);
@@ -833,6 +853,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_GenerateDefaultCh
   }
   arg2 = *argp2;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->GenerateDefaultChildPropertyValues(arg2);
@@ -867,6 +892,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_GenerateDefaultCh
   }
   arg2 = *argp2;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->GenerateDefaultChildPropertyValuesSwigPublic(arg2);
@@ -909,6 +939,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_MeasureChildren(v
   }
   arg3 = *argp3;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->MeasureChildren(arg2,arg3);
@@ -951,6 +986,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_MeasureChildrenSw
   }
   arg3 = *argp3;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->MeasureChildrenSwigPublic(arg2,arg3);
@@ -1001,6 +1041,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_MeasureChild(void
   }
   arg4 = *argp4;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->MeasureChild(arg2,arg3,arg4);
@@ -1051,6 +1096,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_MeasureChildSwigE
   }
   arg4 = *argp4;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->MeasureChildSwigPublic(arg2,arg3,arg4);
@@ -1117,6 +1167,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_MeasureChildWithM
   }
   arg6 = *argp6;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->MeasureChildWithMargins(arg2,arg3,arg4,arg5,arg6);
@@ -1183,6 +1238,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutGroupWrapperImpl_MeasureChildWithM
   }
   arg6 = *argp6;
   darg = dynamic_cast<SwigDirector_LayoutGroupWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutGroupWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->MeasureChildWithMarginsSwigPublic(arg2,arg3,arg4,arg5,arg6);
index 7259015..aa8e43f 100755 (executable)
@@ -967,6 +967,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnUnparent(void *
 
   arg1 = (Dali::Toolkit::Internal::LayoutItem *)jarg1;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnUnparent();
@@ -993,6 +998,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnUnparentSwigExpl
 
   arg1 = (Dali::Toolkit::Internal::LayoutItem *)jarg1;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnUnparentSwigPublic();
@@ -1026,6 +1036,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnRegisterChildPro
   std::string arg2_str(jarg2);
   arg2 = &arg2_str;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnRegisterChildProperties((std::string const &)*arg2);
@@ -1062,6 +1077,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnRegisterChildPro
   std::string arg2_str(jarg2);
   arg2 = &arg2_str;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnRegisterChildPropertiesSwigPublic((std::string const &)*arg2);
@@ -1107,6 +1127,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnMeasure(void * j
   }
   arg3 = *argp3;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnMeasure(arg2,arg3);
@@ -1149,6 +1174,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnMeasureSwigExpli
   }
   arg3 = *argp3;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnMeasureSwigPublic(arg2,arg3);
@@ -1209,6 +1239,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnLayout(void * ja
   }
   arg6 = *argp6;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnLayout(arg2,arg3,arg4,arg5,arg6);
@@ -1269,6 +1304,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnLayoutSwigExplic
   }
   arg6 = *argp6;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnLayoutSwigPublic(arg2,arg3,arg4,arg5,arg6);
@@ -1311,6 +1351,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnSizeChanged(void
   }
   arg3 = *argp3;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnSizeChanged(arg2,arg3);
@@ -1353,6 +1398,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnSizeChangedSwigE
   }
   arg3 = *argp3;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnSizeChangedSwigPublic(arg2,arg3);
@@ -1379,6 +1429,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnInitialize(void
 
   arg1 = (Dali::Toolkit::Internal::LayoutItem *)jarg1;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnInitialize();
@@ -1405,6 +1460,11 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_LayoutItemWrapperImpl_OnInitializeSwigEx
 
   arg1 = (Dali::Toolkit::Internal::LayoutItem *)jarg1;
   darg = dynamic_cast<SwigDirector_LayoutItemWrapperImpl *>(arg1);
+  if(!darg)
+  {
+    SWIG_CSharpException(SWIG_TypeError, "dynamic_cast<SwigDirector_LayoutItemWrapperImpl> error. darg is null");
+    return;
+  }
   {
     try {
       (darg)->OnInitializeSwigPublic();
index 2fefbf9..3f6666d 100755 (executable)
@@ -251,7 +251,7 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_LayoutLength_GreaterThan__SWIG_0
   unsigned int jresult ;
   Dali::Toolkit::LayoutLength *arg1 = (Dali::Toolkit::LayoutLength *) 0 ;
   Dali::Toolkit::LayoutLength *arg2 = 0 ;
-  bool result;
+  bool result = false;
 
   arg1 = (Dali::Toolkit::LayoutLength *)jarg1;
   arg2 = (Dali::Toolkit::LayoutLength *)jarg2;