Skip to content

image: require BMP file header, not just BM - #160

Open
team-humaki wants to merge 1 commit into
h2non:masterfrom
team-humaki:bmp-require-file-header
Open

team-humaki wants to merge 1 commit into
h2non:masterfrom
team-humaki:bmp-require-file-header

Conversation

@team-humaki

Copy link
Copy Markdown

Matching only the two-byte BM signature treated short ASCII such as BMW as image/bmp.

BITMAPFILEHEADER is 14 bytes. The matcher now requires that length and that bfReserved1/bfReserved2 are zero.

Fixes #117

Matching only the two-byte BM signature treats ASCII like "BMW" as
image/bmp. Require the 14-byte BITMAPFILEHEADER and zero reserved
fields.

Fixes h2non#117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ASCII Text Files Starting With Letters "BM" Are Treated As BMP Image Files

1 participant