Closed Bug 1279467 Opened 8 years ago Closed 8 years ago

failing NULL byte pattern in form validation

Categories

(Core :: JavaScript Engine, defect)

46 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox47 --- wontfix
firefox48 --- fixed
firefox49 --- fixed
firefox-esr45 --- unaffected
firefox50 --- fixed

People

(Reporter: mail, Assigned: arai)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:47.0) Gecko/20100101 Firefox/47.0
Build ID: 20160604131506

Steps to reproduce:

create <input pattern="[\0]+"> and set its value to "0".

see http://jsbin.com/noledanoso/edit?html,js,output


Actual results:

the input element was set :invalid


Expected results:

the input element should be valid, as 0 (the number) is not the NULL byte.
Of course the "Steps to reproduce" should've contained ^ to negate the character set:

  <input pattern="[^\0]+">

Note that Firefox used to get this right. Version 45 behaved like Chrome, Safari, IE - i.e. not considering the field invalid for value "0". We've seen this first break in 46.
apparently a bug in RegExp parser.
will fix this shortly.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Forgot to advance the cursor, and \0 is parsed as \0 and 0...
Assignee: nobody → arai.unmht
Attachment #8762086 - Flags: review?(till)
Comment on attachment 8762086 [details] [diff] [review]
Fix null handling in RegExp character class with unicode flag.

Review of attachment 8762086 [details] [diff] [review]:
-----------------------------------------------------------------

Makes sense. r=me
Attachment #8762086 - Flags: review?(till) → review+
See Also: → 1279545
thank you for reviewing :D
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
https://hg.mozilla.org/integration/mozilla-inbound/rev/3e2b029c616d5cd48e7a6647181f392dd9d14ff8
Bug 1279467 - Fix null handling in RegExp character class with unicode flag. r=till
https://hg.mozilla.org/mozilla-central/rev/3e2b029c616d
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Comment on attachment 8762086 [details] [diff] [review]
Fix null handling in RegExp character class with unicode flag.

Approval Request Comment
[Feature/regressing bug #]: bug 1135377
[User impact if declined]: Certain webpage that contains unicode RegExp in JavaScript code, or pattern attribute of INPUT element may behave wrongly
[Describe test coverage new/current, TreeHerder]: testes as automated test in m-c
[Risks and why]: Very low.  Added one missing operation that won't introduce any issue
[String/UUID change made/needed]: None
Attachment #8762086 - Flags: approval-mozilla-release?
Attachment #8762086 - Flags: approval-mozilla-beta?
Attachment #8762086 - Flags: approval-mozilla-aurora?
Comment on attachment 8762086 [details] [diff] [review]
Fix null handling in RegExp character class with unicode flag.

Review of attachment 8762086 [details] [diff] [review]:
-----------------------------------------------------------------

This patch fixes null handling in RegExp. Take it in beta & aurora.
Attachment #8762086 - Flags: approval-mozilla-beta?
Attachment #8762086 - Flags: approval-mozilla-beta+
Attachment #8762086 - Flags: approval-mozilla-aurora?
Attachment #8762086 - Flags: approval-mozilla-aurora+
Note for Ritu, I don't think we need to bring this into a dot release for 47. It regressed in 46 and if the problem were very widespread, we would likely have heard about it earlier or in duplicate bugs.
Comment on attachment 8762086 [details] [diff] [review]
Fix null handling in RegExp character class with unicode flag.

I don't believe this is a critical enough issue to be included in a dot release. Wontfix for 47.
Attachment #8762086 - Flags: approval-mozilla-release? → approval-mozilla-release-
Changing regression version to 46 as per comment 10.
Version: 47 Branch → 46 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: