Explorar o código

Adds null reference check

Signed-off-by: CapXilinx <melik-merkumians@acin.tuwien.ac.at>
CapXilinx %!s(int64=8) %!d(string=hai) anos
pai
achega
bf25fefa9f
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      source/src/cip/cipioconnection.c

+ 4 - 2
source/src/cip/cipioconnection.c

@@ -620,9 +620,11 @@ EipUint16 HandleConfigData(CipConnectionObject *connection_object) {
     assembly_class, connection_object->configuration_path.instance_id);
 
   if (0 != g_config_data_length) {
+    OPENER_ASSERT(NULL != config_instance);
     if ( ConnectionWithSameConfigPointExists(
-           connection_object->configuration_path.instance_id) ) {                                               /* there is a connected connection with the same config point
-                                                                                                                 * we have to have the same data as already present in the config point*/
+           connection_object->configuration_path.instance_id) ) {
+      /* there is a connected connection with the same config point
+       * we have to have the same data as already present in the config point*/
       CipByteArray *attribute_three = (CipByteArray *) GetCipAttribute(
         config_instance,
         3)->data;