Skip to content

cminify crashes on unterminated block comments at the very start of CSS or JS input, for example /*. #8

Description

@CodingMarkus

The root cause is that skip_whitespaces_comments() reports this parse error with error_position = 0, but its CSS and JS callers only treated error_position != 0 as failure. Because of that, the error path was missed when the invalid comment started at byte 0, m.result had already been cleared, and later code dereferenced it, causing a segmentation fault instead of returning a normal parse error.

Expected behavior:
return a clean syntax error like “Unclosed multi-line comment starting in line 1, column 1”.

Actual behavior:
segmentation fault.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions