Closed
Bug 1232180
Opened 9 years ago
Closed 9 years ago
Incorrect regexp used to filter bug IDs in Bugzilla::WebService::BugUserLastVisit
Categories
(Bugzilla :: WebService, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 5.0
People
(Reporter: LpSolit, Assigned: dylan)
References
Details
(Keywords: perf)
Attachments
(2 files, 1 obsolete file)
2.33 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
1.01 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
In Bugzilla/WebService/BugUserLastVisit.pm, in get() and update(), the following code is used to cache bugs:
$user->visible_bugs([grep /^[0-9]$/, @$ids])
/^[0-9]$/ will only catch bugs having only one digit. This regexp should contain [0-9]+ or \d+.
Reporter | ||
Comment 1•9 years ago
|
||
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8697857 [details] [diff] [review]
patch, v1
Review of attachment 8697857 [details] [diff] [review]:
-----------------------------------------------------------------
Nice catch, but please avoid \d in new code unless you really mean all digits of all alphabets (or specify the behavior with the relevant pragma)
Attachment #8697857 -
Flags: review?(dkl) → review-
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to Dylan William Hardison [:dylan] from comment #2)
> Nice catch, but please avoid \d in new code unless you really mean all
> digits of all alphabets (or specify the behavior with the relevant pragma)
\d+ is what we use everywhere in the Bugzilla code, including detaint_natural() which we use everywhere for our security checks. \d+ is safe here because if non-ASCII digits are passed and do not match any bug ID, they will simply be ignored. So IMO, this is not a valid reason to deny review.
And Bugzilla 6.0 will require Perl 5.14 which will allow us to use /a with regexps to force an ASCII comparison, so this distinction won't be relevant either.
Assignee | ||
Comment 4•9 years ago
|
||
Updated patch that also fixes the REST version of BugUserLastVisited.
Attachment #8697857 -
Attachment is obsolete: true
Attachment #8698043 -
Flags: review?(dkl)
Comment 5•9 years ago
|
||
Comment on attachment 8698043 [details] [diff] [review]
1232180_1.patch
Review of attachment 8698043 [details] [diff] [review]:
-----------------------------------------------------------------
r=dkl
Attachment #8698043 -
Flags: review?(dkl) → review+
Comment 6•9 years ago
|
||
Need a patch for 5.0 as well that does not include Bugzilla/API/*
dkl
Reporter | ||
Updated•9 years ago
|
Assignee: LpSolit → dylan
Assignee | ||
Comment 7•9 years ago
|
||
Attachment #8698528 -
Flags: review?(dkl)
Comment 8•9 years ago
|
||
Comment on attachment 8698528 [details] [diff] [review]
5.0.patch
Review of attachment 8698528 [details] [diff] [review]:
-----------------------------------------------------------------
r=dkl
Attachment #8698528 -
Flags: review?(dkl) → review+
Updated•9 years ago
|
Flags: approval5.0+
Flags: approval+
Assignee | ||
Comment 9•9 years ago
|
||
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
e247772..c7affd0 5.0 -> 5.0
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
dee37d0..76ecb18 master -> master
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•