Index: plugins/oa_soap/oa_soap_utils.c
===================================================================
--- plugins/oa_soap/oa_soap_utils.c	(revision 7263)
+++ plugins/oa_soap/oa_soap_utils.c	(working copy)
@@ -212,7 +212,7 @@
         struct getOaNetworkInfo network_info;
         struct oaNetworkInfo network_info_response;
         enum oaRole oa_role;
-        char active_ip[MAX_URL_LEN], standby_ip[MAX_URL_LEN], url[MAX_URL_LEN];
+        char active_ip[MAX_URL_LEN], standby_ip[MAX_URL_LEN], *url = NULL;  
         char active_fm[MAX_BUF_SIZE], standby_fm[MAX_BUF_SIZE];
         char firmware[MAX_BUF_SIZE];
         char *user_name = NULL, *password = NULL;
@@ -229,8 +229,13 @@
         oa_handler = (struct oa_soap_handler *) oh_handler->data;
 
         /* Create the OA URL */
-        memset(url, 0, MAX_URL_LEN);
-        snprintf(url, strlen(server) + strlen(PORT) + 1, "%s" PORT, server);
+        rv = asprintf(&url, "%s" PORT, server);			   
+        if(rv == -1){
+                free(url);
+                err("Failed to allocate memory for buffer to        \
+                                           hold OA credentials");
+                return SA_ERR_HPI_OUT_OF_MEMORY;
+        }
 
         /* Get the user_name and password from config file */
         user_name = (char *) g_hash_table_lookup(oh_handler->config,
@@ -420,14 +425,27 @@
                 other_oa->oa_status = ACTIVE;
                 other_oa->fm_version = atof(active_fm);
                 strncpy(other_oa->server, active_ip, strlen(active_ip));
-                snprintf(url, strlen(active_ip) + strlen(PORT) + 1,
-                         "%s" PORT, active_ip);
+                rv = asprintf(&url, "%s" PORT, active_ip);		      
+                if (rv == -1){
+                        free(url);
+                        err("Failed to allocate memory for buffer to        \
+                                                 hold OA credentials");
+                        return SA_ERR_HPI_OUT_OF_MEMORY;
+                }
+
         } else {
                 other_oa->oa_status = STANDBY;
                 other_oa->fm_version = atof(standby_fm);
                 strncpy(other_oa->server, standby_ip, strlen(standby_ip));
-                snprintf(url, strlen(standby_ip) + strlen(PORT) + 1,
-                         "%s" PORT, standby_ip);
+                rv = asprintf(&url, "%s" PORT, standby_ip);		      
+                if(rv == -1){
+                       free(url);
+                       err("Failed to allocate memory for buffer to        \
+                                                 hold OA credentials");
+
+                       return SA_ERR_HPI_OUT_OF_MEMORY;
+                }
+
         }
 
         /* Initialize the soap_con for hpi and event thread */
@@ -476,7 +494,7 @@
                         return SA_OK;
                 }
         }
-
+	free(url);
         return SA_OK;
 }
 
@@ -1095,19 +1113,25 @@
 SaErrorT initialize_oa_con(struct oa_info *oa,
                            char *user_name,
                            char *password)
-{
-        char url[MAX_URL_LEN];
-
+{       
+        SaErrorT rv = SA_OK; 
+        char *url = NULL;    		    
+        
         if (oa == NULL || user_name == NULL || password == NULL) {
                 err("Invalid parameters");
                 return SA_ERR_HPI_INVALID_PARAMS;
         }
 
         g_mutex_lock(oa->mutex);
-        memset(url, 0, MAX_URL_LEN);
-        snprintf(url, strlen(oa->server) + strlen(PORT) + 1,
-                 "%s" PORT, oa->server);
+        rv = asprintf(&url, "%s" PORT, oa->server);			
+        if(rv == -1){
+                free(url);
+                err("Failed to allocate memory for buffer to        \
+                                             hold OA credentials");
+                return SA_ERR_HPI_OUT_OF_MEMORY;
+        }
 
+
         oa->hpi_con = soap_open(url, user_name, password,
                                 HPI_CALL_TIMEOUT);
         if (oa->hpi_con == NULL) {
@@ -1129,7 +1153,7 @@
                 return SA_ERR_HPI_INTERNAL_ERROR;
         }
         g_mutex_unlock(oa->mutex);
-
+	free(url);
         return SA_OK;
 
 }
Index: plugins/oa_soap/oa_soap_callsupport.c
===================================================================
--- plugins/oa_soap/oa_soap_callsupport.c	(revision 7263)
+++ plugins/oa_soap/oa_soap_callsupport.c	(working copy)
@@ -622,7 +622,7 @@
 {
         int             nbytes;
         int             ret;
-        char            header[OA_SOAP_HEADER_SIZE + 1];
+        char *          header=NULL;                              
         char            response[OA_SOAP_RESP_BUFFER_SIZE];
         xmlParserCtxtPtr parse;
 
@@ -649,8 +649,15 @@
         nbytes = strlen(request);
         if (connection->req_high_water < nbytes)
                 connection->req_high_water = nbytes;
-        snprintf(header, OA_SOAP_HEADER_SIZE, OA_XML_HEADER,
-                 connection->server, nbytes);
+        ret = asprintf(&header, OA_XML_HEADER,			
+                 connection->server, nbytes);			
+        if(ret == -1){
+                free(header);
+                err("Failed to allocate memory for buffer to        \
+                                           hold OA XML header");
+                return(-1);
+        }
+
         /* TODO: On that last line, I think server includes port...fix that,
          * though it doesn't seem to be causing any problems.
          */
@@ -765,7 +772,7 @@
                 xmlFreeParserCtxt(parse);
                 return(-1);
         }
-
+	free(header);
         xmlFreeParserCtxt(parse);
         return(0);
 }
@@ -789,7 +796,8 @@
  **/
 static int      soap_login(SOAP_CON *connection)
 {
-        char            buf[OA_SOAP_LOGIN_SIZE];
+        int             ret = 0;
+        char *          buf = NULL; 			 	
         xmlDocPtr       doc;
         xmlNode         *login_element;
         xmlNode         *fault;
@@ -809,9 +817,16 @@
         }
 
         /* Generate login request */
-        snprintf(buf, OA_SOAP_LOGIN_SIZE, OA_XML_LOGIN,
-                 connection->username, connection->password);
+        ret = asprintf(&buf, OA_XML_LOGIN,				 
+                 connection->username, connection->password); 	
+        if(ret == -1){
+                free(buf);
+                err("Failed to allocate memory for buffer to hold    \
+			                      OA login credentials");
+                return -1;
+        }
 
+ 
         /* Perform login request */
         if (soap_message(connection, buf, &doc)) {
                 err("failed to communicate with OA during login");
@@ -831,6 +846,7 @@
                         OA_SOAP_SESSIONKEY_SIZE);
                 dbg("Opened session ID %s", connection->session_id);
                 /* Free the XML document */
+                free(buf);
                 xmlFreeDoc(doc);
                 return(0);              /* Normal, successful return */
         }
@@ -851,6 +867,7 @@
         else {
                 err("failed to find session ID during OA login");
         }
+        free(buf);
         xmlFreeDoc(doc);
         return(-1);
 }
Index: plugins/oa_soap/oa_soap_inventory.c
===================================================================
--- plugins/oa_soap/oa_soap_inventory.c	(revision 7263)
+++ plugins/oa_soap/oa_soap_inventory.c	(working copy)
@@ -1359,8 +1359,7 @@
         local_inventory->info.area_list = NULL;
         local_inventory->comment =
                 (char *)g_malloc0(strlen(enclosure_inv_str) + 1);
-        snprintf(local_inventory->comment, strlen(enclosure_inv_str) + 1,
-                 "%s", enclosure_inv_str);
+        strcpy(local_inventory->comment, enclosure_inv_str);
 
         /* Create and add product area if resource name and/or manufacturer
          * information exist
@@ -1543,8 +1542,7 @@
         local_inventory->info.idr_info.NumAreas = 0;
         local_inventory->info.area_list = NULL;
         local_inventory->comment = (char *)g_malloc0(strlen(oa_inv_str) + 1);
-        snprintf(local_inventory->comment, strlen(oa_inv_str) + 1,
-                 "%s", oa_inv_str);
+        strcpy(local_inventory->comment, oa_inv_str);
 
         /* Create and add product area if resource name and/or manufacturer
          * information exist
@@ -1723,8 +1721,7 @@
         local_inventory->info.area_list = NULL;
         local_inventory->comment =
                 (char *)g_malloc0(strlen(server_inv_str) + 1);
-        snprintf(local_inventory->comment, strlen(server_inv_str) + 1,
-                 "%s", server_inv_str);
+        strcpy(local_inventory->comment, server_inv_str);
 
         /* Create and add product area if resource name and/or manufacturer
          * information exist
@@ -1908,9 +1905,7 @@
         local_inventory->info.area_list = NULL;
         local_inventory->comment =
                 (char *)g_malloc0(strlen(server_inv_str) + 1);
-        snprintf(local_inventory->comment, strlen(server_inv_str) + 1,
-                 "%s", server_inv_str);
-
+	strcpy(local_inventory->comment, server_inv_str);
         *inventory = local_inventory;
         return SA_OK;
 }
@@ -2170,8 +2165,7 @@
         local_inventory->info.area_list = NULL;
         local_inventory->comment =
                 (char *)g_malloc0(strlen(interconnect_inv_str) + 1);
-        snprintf(local_inventory->comment, strlen(interconnect_inv_str) + 1,
-                 "%s", interconnect_inv_str);
+        strcpy(local_inventory->comment, interconnect_inv_str);
 
         /* Create and add product area if resource name and/or manufacturer
          * information exist
@@ -2335,8 +2329,7 @@
         local_inventory->info.idr_info.NumAreas = 0;
         local_inventory->info.area_list = NULL;
         local_inventory->comment = (char *)g_malloc0(strlen(fan_inv_str) + 1);
-        snprintf(local_inventory->comment, strlen(fan_inv_str) + 1,
-                 "%s", fan_inv_str);
+       strcpy(local_inventory->comment, fan_inv_str);		
 
         /* Create and add product area if resource name and/or manufacturer
          * information exist
@@ -2468,9 +2461,10 @@
         local_inventory->info.idr_info.NumAreas = 0;
         local_inventory->info.area_list = NULL;
         local_inventory->comment = (char *)g_malloc0(strlen(power_inv_str) + 1);
-        snprintf(local_inventory->comment, strlen(power_inv_str) + 1,
-                 "%s", power_inv_str);
 
+        strcpy(local_inventory->comment, power_inv_str);		  
+	
+
         /* Create and add board area if resource part number and/or
          * serial number exist
          */
@@ -4225,7 +4219,7 @@
 	}
 
 
-	/* Set the product name */
+	/* Set the product name*/
 	oa_soap_inv_set_field(inventory->info.area_list,
 			      SAHPI_IDR_AREATYPE_PRODUCT_INFO,
 			      SAHPI_IDR_FIELDTYPE_PRODUCT_NAME,
Index: plugins/oa_soap/oa_soap_event.c
===================================================================
--- plugins/oa_soap/oa_soap_event.c	(revision 7263)
+++ plugins/oa_soap/oa_soap_event.c	(working copy)
@@ -110,7 +110,7 @@
         SaHpiBoolT is_plugin_initialized = SAHPI_FALSE;
         SaHpiBoolT is_discovery_completed = SAHPI_FALSE;
         SaHpiBoolT listen_for_events = SAHPI_TRUE;
-        char *user_name, *password, url[MAX_URL_LEN];
+        char *user_name, *password, *url = NULL;  
 
         if (oa_pointer == NULL) {
                 err("Invalid parameter");
@@ -207,9 +207,14 @@
         /* Ideally, the soap_open should pass in 1st try.
          * If not, try until soap_open succeeds
          */
-        memset(url, 0, MAX_URL_LEN);
-        snprintf(url, strlen(oa->server) + strlen(PORT) + 1,
+        rv = asprintf(&url, 				
                  "%s" PORT, oa->server);
+        if(rv == -1){
+                free(url);
+                err("Failed to allocate memory for buffer to        \
+                                             hold OA credentials");
+                return (gpointer*) SA_ERR_HPI_OUT_OF_MEMORY;
+        } 		
         while (oa->event_con2 == NULL) {
         	OA_SOAP_CHEK_SHUTDOWN_REQ(oa_handler, NULL, NULL, NULL);
                 oa->event_con2 = soap_open(url, user_name, password,
@@ -262,11 +267,17 @@
                                         soap_close(oa->event_con2);
                                         oa->event_con2 = NULL;
                                 }
-                                memset(url, 0, MAX_URL_LEN);
-                                snprintf(url, strlen(oa->server) +
-                                         strlen(PORT) + 1,
-                                        "%s" PORT, oa->server);
+                                rv = asprintf(&url, "%s" PORT, oa->server);  	
+                                if(rv == -1){
+                                        free(url);
+                                        err("Failed to allocate memory for	\
+                                                  buffer to hold OA credentials");
 
+                                        return (gpointer*) SA_ERR_HPI_OUT_OF_MEMORY;
+                                }
+
+
+
                                 /* Ideally, the soap_open should pass in
                                  * 1st try. If not, try until soap_open succeeds
                                  */
@@ -291,7 +302,7 @@
                 } /* end of else (SOAP call failure handling) */
 
         } /* end of 'while(listen_for_events == SAHPI_TRUE)' loop */
-
+	free(url);
         return (gpointer *) SA_OK;
 }
 
