Skip to content

get_primitive_in_translation_space() fails to check return from get_primitive() #571

@krefson

Description

@krefson

The function get_primitive_in_translation_space() calls get_primitive() on line src/primitive.c:652, but fails to test whether the value returned is NULL.

This can cause a segmentation fault at line 656 where pointer "primitive" is dereferenced.

I managed to provoke a crash by calling get_hall_number_from_symmetry() with a doubled set of symmetry operations in which every rotation and translation was duplicated.

I could try to come up with a test input, but the fix looks fairly obvious - just handle a failure of get_primitive() correctly.

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