Skip to content

outer.c: fix recode_declare_single error path - #77

Merged
rrthomas merged 1 commit into
rrthomas:masterfrom
prownd:outer.c-fix-recode_declare_single-error-path-s01
Sep 23, 2026
Merged

rrthomas merged 1 commit into
rrthomas:masterfrom
prownd:outer.c-fix-recode_declare_single-error-path-s01

Conversation

@prownd

@prownd prownd commented Sep 21, 2026

Copy link
Copy Markdown

recode_find_alias returns NULL when it cannot allocate a new symbol, but its result was dereferenced before being checked. The cleanup code that followed was also wrong: it deleted an alias (and its symbol) still referenced by the alias table and symbol list, and it unlinked the single step without decrementing number_of_singles, so that recode_delete_outer would later walk past the end of the list.

Check the aliases before using them, leave them to the alias table, and keep number_of_singles consistent.

recode_find_alias returns NULL when it cannot allocate a new symbol,
but its result was dereferenced before being checked.  The cleanup
code that followed was also wrong: it deleted an alias (and its symbol)
still referenced by the alias table and symbol list, and it unlinked
the single step without decrementing number_of_singles, so that
recode_delete_outer would later walk past the end of the list.

Check the aliases before using them, leave them to the alias table,
and keep number_of_singles consistent.
@rrthomas
rrthomas merged commit 3a83979 into rrthomas:master Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants