Project

General

Profile

Actions

Bug #1289

closed

MPM b2gm matcher has questionable code

Added by Ken Steele over 9 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

The B2GM MPM matcher has questionable code related to use of B2gmPattern1 structures. These are only used for patterns of length 1.

The array ctx->patterns1 is of type uint8_t*, but are then always cast to B2gmPattern1 pointers. Why is patterns1 not of type (B2gmPattern1*)?
Offsets into the uint8_t array are started at 1 with a comment about skipping the first byte of the buffer. This will always result in unaligned access to the structure.

Actions

Also available in: Atom PDF