This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29243 - "While sequence[s] is a whitespace character, co..."
Summary: "While sequence[s] is a whitespace character, co..."
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: MIME (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Gordon P. Hemsley
QA Contact: sideshowbarker+mimespec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-26 11:27 UTC by pyfisch
Modified: 2016-02-15 18:49 UTC (History)
1 user (show)

See Also:


Attachments

Description pyfisch 2015-10-26 11:27:25 UTC
https://mimesniff.spec.whatwg.org/#parsing-a-mime-type

[[
While sequence[s] is a whitespace character, continuously execute the following steps:

    Increment s by 1. 
]]

The loop does not check if `sequence[s]` exists. An invalid media type like `   ` either raises an out-of-bounds error or reads memory outside of `sequence`. All other loops include the check "If sequence[s] is undefined, return undefined.".
Comment 1 Gordon P. Hemsley 2016-02-15 18:33:53 UTC
Fixed by PR #2:

https://github.com/whatwg/mimesniff/pull/2