Closed Bug 341672 Opened 18 years ago Closed 18 years ago

xsd:double validation has a problem

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: doronr)

Details

(Keywords: fixed1.8.0.8, fixed1.8.1.1)

Attachments

(2 files)

"10abc" is not found to be invalid if set as the value of a node with type xsd:double
Attached file testcase (deleted) —
second input should show up as red
Attached patch le patch (deleted) — Splinter Review
The bug here is that the current end pointer check only worked when the first character was invalid. Rather, just check if it's not at the end (null pointer)
Assignee: xforms → doronr
Status: NEW → ASSIGNED
Attachment #225767 - Flags: review?(aaronr)
Comment on attachment 225767 [details] [diff] [review] le patch >Index: extensions/schema-validation/src/nsSchemaValidatorUtils.cpp >=================================================================== >RCS file: /cvsroot/mozilla/extensions/schema-validation/src/nsSchemaValidatorUtils.cpp,v >retrieving revision 1.15 >diff -1 -0 -u -p -r1.15 nsSchemaValidatorUtils.cpp >--- extensions/schema-validation/src/nsSchemaValidatorUtils.cpp 24 May 2006 06:44:21 -0000 1.15 >+++ extensions/schema-validation/src/nsSchemaValidatorUtils.cpp 15 Jun 2006 20:49:02 -0000 >@@ -118,32 +118,33 @@ nsSchemaValidatorUtils::IsValidSchemaDou > PRBool isValid = PR_TRUE; > > if (*aString == 0) > return PR_FALSE; > > char * pEnd; > double value = PR_strtod(aString, &pEnd); > > // If end pointer hasn't moved, then the string wasn't a > // true double (could be INF, -INF or NaN though) >- if (pEnd == aString) { >+ if (*pEnd != '\0') { > nsCAutoString temp(aString); you need to change the commet above this test with that, r=me
Attachment #225767 - Flags: review?(aaronr) → review+
Attachment #225767 - Flags: review?(smaug)
Attachment #225767 - Flags: review?(smaug) → review?(Olli.Pettay)
Attachment #225767 - Flags: review?(Olli.Pettay) → review?(Olli.Pettay)
Attachment #225767 - Flags: review?(Olli.Pettay) → review+
checked into trunk
Whiteboard: xf-to-branch
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
checked into 1.8.0 branch on 2006/09/21
Keywords: fixed1.8.0.8
checked into 1.8 branch on 2006/11/21
Keywords: fixed1.8.1.1
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: