ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r550377 - in /webservices/sandesha/trunk/c/src: client/client.c util/sandesha2_utils.c
Date Mon, 25 Jun 2007 06:18:43 GMT
Author: samisa
Date: Sun Jun 24 23:18:42 2007
New Revision: 550377

URL: http://svn.apache.org/viewvc?view=rev&rev=550377
Log:
Fixed seg faults due to non checking of pointer validity

Modified:
    webservices/sandesha/trunk/c/src/client/client.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c

Modified: webservices/sandesha/trunk/c/src/client/client.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/client.c?view=diff&rev=550377&r1=550376&r2=550377
==============================================================================
--- webservices/sandesha/trunk/c/src/client/client.c (original)
+++ webservices/sandesha/trunk/c/src/client/client.c Sun Jun 24 23:18:42 2007
@@ -417,7 +417,10 @@
 
     conf = axis2_conf_ctx_get_conf(conf_ctx, env);
     storage_mgr = sandesha2_utils_get_storage_mgr(env, conf_ctx, conf);
-    seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
+    if (storage_mgr)
+    {
+        seq_prop_mgr = sandesha2_storage_mgr_get_seq_property_mgr(storage_mgr, env);
+    }
     sandesha2_report = sandesha2_report_create(env);
     internal_seq_find_bean = sandesha2_seq_property_bean_create(env);
     ctx = axis2_conf_ctx_get_base(conf_ctx, env);
@@ -440,16 +443,22 @@
         }
         if(AXIS2_TRUE != within_transaction)
         {
-            report_transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, 
-                env);
+            if (storage_mgr)
+            {
+                report_transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, 
+                    env);
+            }
         }
         client_report_transaction = report_transaction;
     }
     if(internal_seq_find_bean) 
         sandesha2_seq_property_bean_set_name(internal_seq_find_bean, env, 
             SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID);
-    collection = sandesha2_seq_property_mgr_find(seq_prop_mgr, env, 
-        internal_seq_find_bean);
+    if (seq_prop_mgr)
+    {
+        collection = sandesha2_seq_property_mgr_find(seq_prop_mgr, env, 
+            internal_seq_find_bean);
+    }
     if(collection)
         size = axutil_array_list_size(collection, env);
     for(i = 0; i < size; i++)
@@ -485,8 +494,11 @@
     if(svr_completed_msgs_find_bean)
         sandesha2_seq_property_bean_set_name(svr_completed_msgs_find_bean, env, 
             SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
-    svr_completed_msgs_beans = sandesha2_seq_property_mgr_find(seq_prop_mgr, 
-        env, svr_completed_msgs_find_bean);
+    if (seq_prop_mgr)
+    {
+        svr_completed_msgs_beans = sandesha2_seq_property_mgr_find(seq_prop_mgr, 
+            env, svr_completed_msgs_find_bean);
+    }
     if(svr_completed_msgs_beans)
         size = axutil_array_list_size(svr_completed_msgs_beans, env);
     for(i = 0; i < size; i++)

Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?view=diff&rev=550377&r1=550376&r2=550377
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Sun Jun 24 23:18:42 2007
@@ -165,10 +165,14 @@
     axutil_allocator_switch_to_global_pool(env->allocator);
     prop_bean = (sandesha2_property_bean_t *)sandesha2_utils_get_property_bean(
         env, conf);
-    value = sandesha2_property_bean_get_storage_mgr(prop_bean, env);
-    if(0 == axutil_strcmp(value, SANDESHA2_INMEMORY_STORAGE_MGR))
+    if (prop_bean)
+    {
+        value = sandesha2_property_bean_get_storage_mgr(prop_bean, env);
+    }
+    
+    if(value && (0 == axutil_strcmp(value, SANDESHA2_INMEMORY_STORAGE_MGR)))
         storage_mgr = sandesha2_utils_get_inmemory_storage_mgr(env, conf_ctx);
-    else if (0 == axutil_strcmp(value, SANDESHA2_PERMANENT_STORAGE_MGR))
+    else if (value && (0 == axutil_strcmp(value, SANDESHA2_PERMANENT_STORAGE_MGR)))
         storage_mgr = sandesha2_utils_get_permanent_storage_mgr(env, conf_ctx);
     else
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Mime
View raw message