mx4j/src/core/javax/management ObjectName.java,1.24,1.25
Jeremy Boynes <[email protected]> Tue, 08 Feb 2005 00:37:35 +0000
| Newsgroups | gmane.comp.java.mx4j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mx4j/mx4j/src/core/javax/management
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11283/src/core/javax/management
Modified Files:
ObjectName.java
Log Message:
Fix for 1115194 - with new testcase that illustrates the problem
Index: ObjectName.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/ObjectName.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** ObjectName.java 13 Nov 2004 16:38:22 -0000 1.24
--- ObjectName.java 8 Feb 2005 00:37:32 -0000 1.25
***************
*** 604,607 ****
--- 604,617 ----
if (value.trim().startsWith("\""))
{
+ // strip leading and trailing spaces
+ value = value.trim();
+
+ // check value has quotes at start and end
+ if (value.length() < 2) return false;
+ if (value.charAt(value.length()-1) != '"') return false;
+
+ // check final quote is not escaped
+ if (countBackslashesBackwards(value, value.length()-1) % 2 == 1) return false;
+
// Unquote the value
value = value.substring(1, value.length() - 1);
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click