Permalink
Browse files

[ 1690525 ] sfcb: instance comparison might fail in case of NULL pointer

  • Loading branch information...
1 parent 1f2dbbc commit 7fe47d7294c311242851cda3b3ae76d9838136f6 sschuetz committed Apr 3, 2007
Showing with 10 additions and 1 deletion.
  1. +4 −0 ChangeLog
  2. +6 −1 instance.c
View
@@ -2,6 +2,10 @@
* queryOperation.c:
Fixed 169353: problem with certain queries
+
+ * instance.c:
+ 2nd fix for 1690525: instance comparison might fail in case of NULL
+ pointer
2007-03-29 Sven Schuetz <sven@de.ibm.com>
View
@@ -1,5 +1,5 @@
/*
- * $Id: instance.c,v 1.33 2007/03/29 12:38:36 mihajlov Exp $
+ * $Id: instance.c,v 1.34 2007/04/03 13:15:47 sschuetz Exp $
*
* © Copyright IBM Corp. 2005, 2007
*
@@ -745,6 +745,11 @@ int instanceCompare(CMPIInstance *inst1, CMPIInstance *inst2)
CMPIStatus st = { CMPI_RC_OK, NULL };
CMPIData d1, d2;
CMPIString *propName;
+
+ /* check if we have null pointers for our instances */
+ if(inst1 == NULL && inst2 == NULL) return 0; /*identical*/
+ if(inst1 == NULL) return -1; /* inst1 is less than inst2 */
+ if(inst2 == NULL) return 1; /* inst2 is less than inst1 */
c = inst1->ft->getPropertyCount(inst1, NULL);

0 comments on commit 7fe47d7

Please sign in to comment.