Browse files

Fix data_data, esp. handling of CMPI Null values

data_data is for converting CMPIData (C language) to CMPIData (target
language), so don't try any value conversions (for Null or Array values)

data_value converts the CMPIData value to the target value.

Reported as issue #3 by mibanescu

Fix by: https://github.com/mibanescu
  • Loading branch information...
1 parent c20b419 commit 48b429a81abe0310d07e107af8af8ab9ca545466 @kkaempf committed Mar 12, 2012
Showing with 8 additions and 15 deletions.
  1. +1 −1 VERSION.cmake
  2. +7 −0 package/cmpi-bindings.changes
  3. +0 −14 swig/cmpi.i
View
2 VERSION.cmake
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "5")
-SET(VERSION_PATCH "0")
+SET(VERSION_PATCH "1")
View
7 package/cmpi-bindings.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Mar 12 09:33:14 UTC 2012 - kkaempf@suse.com
+
+- Update to 0.5.1
+ Confine data_data to wrapping CMPIData, don't convert the value
+ (fixes issue #3 reported by mibanescu)
+
+-------------------------------------------------------------------
Mon Mar 5 14:58:44 UTC 2012 - kkaempf@suse.com
- Update to 0.5.0
View
14 swig/cmpi.i
@@ -330,20 +330,6 @@ data_data(const CMPIData *dp)
else if (dp->state & (unsigned short)CMPI_badValue) {
SWIG_exception(SWIG_ValueError, "bad value");
}
- else if (dp->state & CMPI_nullValue) {
- result = Target_Null;
- Target_INCREF(result);
- }
- else if ((dp->type) & CMPI_ARRAY) {
- int size = CMGetArrayCount(dp->value.array, NULL);
- int i;
- result = Target_SizedArray(size);
- for (i = 0; i < size; ++i) {
- CMPIData data = CMGetArrayElementAt(dp->value.array, i, NULL);
- Target_Type value = data_data(&data);
- Target_ListSet(result, i, value);
- }
- }
else {
result = SWIG_NewPointerObj((void*) data_clone(dp), SWIGTYPE_p__CMPIData, SWIG_POINTER_OWN);
}

0 comments on commit 48b429a

Please sign in to comment.