Fix null pointer dereference in yasm_section_bcs_append (#263)

master
haruki3hhh 5 months ago committed by GitHub
parent 9defefae9f
commit 121ab150b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      libyasm/section.c

@ -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(&sect->bcs, bc, link);

Loading…
Cancel
Save