mirror of
https://github.com/yasm/yasm
synced 2026-08-26 22:26:05 -04:00
Fix null pointer dereference in yasm_section_bcs_append (#263)
This commit is contained in:
parent
9defefae9f
commit
121ab150b3
1 changed files with 4 additions and 0 deletions
|
|
@ -629,6 +629,10 @@ yasm_bytecode *
|
|||
yasm_section_bcs_append(yasm_section *sect, yasm_bytecode *bc)
|
||||
{
|
||||
if (bc) {
|
||||
if (!sect) {
|
||||
yasm_error_set(YASM_ERROR_VALUE, "Attempt to append bytecode to a NULL section or with a NULL bytecode");
|
||||
return NULL;
|
||||
}
|
||||
if (bc->callback) {
|
||||
bc->section = sect; /* record parent section */
|
||||
STAILQ_INSERT_TAIL(§->bcs, bc, link);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue