From: Chris B. <buc...@us...> - 2012-12-12 22:09:33
|
Update of /cvsroot/sblim/sfcb In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26049 Modified Files: cimXmlGen.c cimXmlParser.c cimXmlParser.h cimXmlRequest.c ChangeLog NEWS Log Message: [ 3582039 ] SFCB should reject empty <VALUE> in most instances Index: cimXmlRequest.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlRequest.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- cimXmlRequest.c 8 Aug 2012 20:35:35 -0000 1.75 +++ cimXmlRequest.c 12 Dec 2012 22:09:30 -0000 1.76 @@ -2163,11 +2163,15 @@ _SFCB_RETURN(rsegs); } } - - if (p->value.value) { - CMPIValue val = str2CMPIValue(p->type, p->value, &p->valueRef, req->op.nameSpace.data, &st); - CMAddArg(in, p->name, &val, p->type); - } + + if (p->value.value) { + CMPIValue val = str2CMPIValue(p->type, p->value, &p->valueRef, req->op.nameSpace.data, &st); + if (st.rc) { + rsegs = methodErrResponse(hdr, getErrSegment(st.rc, NULL)); + _SFCB_RETURN(rsegs); + } + CMAddArg(in, p->name, &val, p->type); + } } sreq.in = setArgsMsgSegment(in); Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.812 retrieving revision 1.813 diff -u -d -r1.812 -r1.813 --- ChangeLog 5 Dec 2012 23:29:02 -0000 1.812 +++ ChangeLog 12 Dec 2012 22:09:30 -0000 1.813 @@ -1,3 +1,9 @@ +2012-12-12 Chris Buccella <buc...@li...> + + * cimXmlGen.c, cimXmlParser.c, cimXmlParser.h, cimXmlRequest.c, + test/xmltest/3582039-*.[xml,OK]: + [ 3582039 ] SFCB should reject empty <VALUE> in most instances + 2012-12-05 Michael Chase-Salerno <br...@li...> * cimcClientSfcbLocal.c: Index: cimXmlGen.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlGen.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- cimXmlGen.c 13 Jun 2012 21:21:09 -0000 1.78 +++ cimXmlGen.c 12 Dec 2012 22:09:30 -0000 1.79 @@ -349,6 +349,12 @@ type=guessType(val.value); } + /* empty VALUE for numerics is invalid XML (DSP201) */ + if ((val.isEmpty) && (type & CMPI_UINT) && !(type & CMPI_ARRAY)) { + status->rc = CMPI_RC_ERR_INVALID_PARAMETER; + return (CMPIValue)CMPI_null; + } + if (type & CMPI_ARRAY) { /* array type received -- needs special handling */ int i, max; @@ -370,13 +376,17 @@ value.array = TrackedCMPIArray(max,t,NULL); if (value.array != NULL) { for (i=0; i<max; i++) { - v = str2CMPIValue(t, arr->values[i], refarr->values+i,ns, &rc); - CMSetArrayElementAt(value.array, i, &v, t); + v = str2CMPIValue(t, arr->values[i], refarr->values+i,ns, &rc); + if (rc.rc) { + status->rc = rc.rc; + return (CMPIValue)CMPI_null; + } + CMSetArrayElementAt(value.array, i, &v, t); } return value; } } - + switch (type) { case CMPI_char16: value.char16 = *val.value; Index: cimXmlParser.h =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlParser.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- cimXmlParser.h 12 Mar 2012 22:30:52 -0000 1.15 +++ cimXmlParser.h 12 Dec 2012 22:09:30 -0000 1.16 @@ -119,6 +119,7 @@ struct xtokClass *class; }; TypeValue type; + char isEmpty; } XtokValue; typedef struct xtokValueArray { Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcb/NEWS,v retrieving revision 1.727 retrieving revision 1.728 diff -u -d -r1.727 -r1.728 --- NEWS 5 Dec 2012 23:29:02 -0000 1.727 +++ NEWS 12 Dec 2012 22:09:30 -0000 1.728 @@ -28,6 +28,7 @@ - 3588557 Object path in deliverIndication can remain resident - 3452703 Default http uid used causes unexpected behavior - 3593006 trace shared mem leak +- 3582039 SFCB should reject empty <VALUE> in most instances Changes in 1.3.15 ================= Index: cimXmlParser.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlParser.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- cimXmlParser.c 14 Jun 2012 23:43:20 -0000 1.38 +++ cimXmlParser.c 12 Dec 2012 22:09:30 -0000 1.39 @@ -947,6 +947,7 @@ char *v; if (attrsOk(parm->xmb, elm, attr, "VALUE", ZTOK_VALUE)) { v=getContent(parm->xmb); /* v is a pointer to where the content starts*/ + lvalp->xtokValue.isEmpty = (v != NULL && strlen(v) > 0) ? 0 : 1; lvalp->xtokValue.value = v; return XTOK_VALUE; } @@ -1019,6 +1020,7 @@ if (attrsOk(parm->xmb, elm, attr, "VALUE.NAMEDINSTANCE", ZTOK_VALUENAMEDINSTANCE)) { lvalp->xtokValue.value = getContent(parm->xmb); + lvalp->xtokValue.isEmpty = 0; return XTOK_VALUENAMEDINSTANCE; } } @@ -1035,6 +1037,7 @@ if (attrsOk(parm->xmb, elm, attr, "INSTANCEPATH", ZTOK_INSTANCEPATH)) { lvalp->xtokValue.value = getContent(parm->xmb); + lvalp->xtokValue.isEmpty = 0; return XTOK_INSTANCEPATH; } } @@ -1051,6 +1054,7 @@ if (attrsOk(parm->xmb, elm, attr, "NAMESPACEPATH", ZTOK_NAMESPACEPATH)) { lvalp->xtokValue.value = getContent(parm->xmb); + lvalp->xtokValue.isEmpty = 0; return XTOK_NAMESPACEPATH; } } @@ -1067,6 +1071,7 @@ if (attrsOk(parm->xmb, elm, attr, "VALUE.REFERENCE", ZTOK_VALUEREFERENCE)) { lvalp->xtokValue.value = getContent(parm->xmb); + lvalp->xtokValue.isEmpty = 0; return XTOK_VALUEREFERENCE; } } |