[ 2348900 ] Concurrency issue when parsing responses
diff --git a/ChangeLog b/ChangeLog
index fcb8c26..ec0de89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-13 Chris Buccella <buccella@linux.vnet.ibm.com>
+
+ * backend/cimxml/cimXmlParser.c:
+ [ 2348900 ] Concurrency issue when parsing responses
+
2010-09-27 Chris Buccella <buccella@linux.vnet.ibm.com>
* backend/cimxml/client.c:
diff --git a/NEWS b/NEWS
index 1f1ff93..9d173f7 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@
- 3043288: XML generated with VALUE.ARRAY for ref arrays
- 3043282: XML gen for embedded instances for invokeMethod is incorrect
- 3059060: 'struct _CIMCArgsFT' not defined in cimc/cimcft.h
+- 2348900: Concurrency issue when parsing responses
Changes in 2.2.1
================
diff --git a/backend/cimxml/cimXmlParser.c b/backend/cimxml/cimXmlParser.c
index fb41459..3e0baef 100644
--- a/backend/cimxml/cimXmlParser.c
+++ b/backend/cimxml/cimXmlParser.c
@@ -32,11 +32,12 @@
#include "dmalloc.h"
#endif
+#include <pthread.h>
+
#ifdef LARGE_VOL_SUPPORT
// New begin
#include <curl/curl.h> // new
-#include <pthread.h> // new
#include <time.h> // new
#include <sys/time.h> // new
#include <setjmp.h> // new
@@ -1363,8 +1364,12 @@
}
#endif
+static pthread_mutex_t scan_mutex = PTHREAD_MUTEX_INITIALIZER;
+
ResponseHdr scanCimXmlResponse(const char *xmlData, CMPIObjectPath *cop)
{
+
+ pthread_mutex_lock(&scan_mutex);
ParserControl control;
#if DEBUG
extern int do_debug;
@@ -1393,6 +1398,8 @@
releaseXmlBuffer(xmb);
+ pthread_mutex_unlock(&scan_mutex);
+
return control.respHdr;
}