Skip to content

Segfault calling to_string() on empty query #290

@dubrowgn

Description

@dubrowgn
let q = world.query::<()>().build();
println!("q-empty: {:?}", q.to_string());

Results in:

Segmentation fault (core dumped)

A look at ecs_query_str() shows it returns NULL when the query term count is 0, while APIQuery::to_string() does not check for a NULL return value.

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