From: Tyrel D. <ty...@us...> - 2011-06-22 05:41:34
|
Update of /cvsroot/sblim/wbemcli In directory vz-cvs-3.sog:/tmp/cvs-serv16118 Modified Files: CimXml.cpp NEWS contributions.txt Log Message: Fixed 3216622: wbemcli throws parser error on CDATA string value (Patch by Chris Poblete) Index: NEWS =================================================================== RCS file: /cvsroot/sblim/wbemcli/NEWS,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- NEWS 22 Jun 2011 05:33:02 -0000 1.39 +++ NEWS 22 Jun 2011 05:41:32 -0000 1.40 @@ -3,6 +3,7 @@ Bugs: - 3324380 support optional CIMType in KEYVALUE element +- 3216622 wbemcli throws parser error on CDATA string value Changes in Version 1.6.1 ======================== Index: contributions.txt =================================================================== RCS file: /cvsroot/sblim/wbemcli/contributions.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- contributions.txt 19 Jun 2009 21:48:16 -0000 1.6 +++ contributions.txt 22 Jun 2011 05:41:32 -0000 1.7 @@ -18,6 +18,10 @@ ******************************************************************************** +06/21/2011 by Chris Poblete, Dell +--------------------------------- +[ 3216622 ] wbemcli throws parser error on CDATA string value + 06/19/2009 by Gokula Kannan, AMI -------------------------------- [ 2100880 ] wbemcli : No Namespace in Response Index: CimXml.cpp =================================================================== RCS file: /cvsroot/sblim/wbemcli/CimXml.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- CimXml.cpp 22 Jun 2011 05:33:02 -0000 1.69 +++ CimXml.cpp 22 Jun 2011 05:41:32 -0000 1.70 @@ -2747,7 +2747,25 @@ } } - else val=string(xb.getContent(&attr)); + else { + if (!strncmp(xb.cur, "<![CDATA[", 8)) { + char *start = xb.cur; + char *end = strstr(start, "]]>"); + char *cdataval; + + if (end == NULL) + throw ParseException("Failed to get CDATA end tag."); + + start += 9; // skip CDATA begin tag + end--; // skip CDATA end tag + cdataval = strndup(start, ((end - start) + 1)); + val=string(cdataval); + free(cdataval); + xb.cur = (end + 4); // move current pointer past CDATA section + } else { + val=string(xb.getContent(&attr)); + } + } tag=xb.nextTag(); if (xb.nextEquals(tag,"/VALUE")) { |