Skip to content

Unbounded sscanf into a 5-byte buffer in the compiled frame parser #236

Description

@galjos

process_lines_with_atoms reads the atom label with sscanf("%s") into char[5]. A 56-character label silently corrupts the parsed coordinates (returns 0,0,0 instead of the actual values); a 64-character label crashes the interpreter with SIGSEGV. The pure-Python fallback accepts any length, so compiled and source installs disagree.

Not reachable with chemical data — the longest supported custom label is ~13 characters — but a corrupt file should raise, not smash the stack.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions