Skip to content

hb_vector_t is not nestable #1227

@blueshade7

Description

@blueshade7

Template hb_vector_t::fini () frees its allocated buffer as:

if (arrayZ != static_array)
  free (arrayZ);

The condition may hold true even when arrayZ points to a static array, if the struct has been moved in memory, ending up in a crash in free ().

This prevents hb_vector_t from being nested, because a lower level hb_vector_t may be realloc'ed in memory by a higher level hb_vector_t. It may be a limitation of hb_vector_t, but even so an obscure crash is not a kind way to tell a developer about the limitation.

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