Fix: Use of uninitialized memory

* config/tc-riscv.c (riscv_ip_hardcode): Fully initialise the allocated riscv_opcode structure.
This commit is contained in:
Jacob Navia 2023-09-18 12:03:58 +01:00 committed by Nick Clifton
parent cb27750702
commit cf2ab5ef0b
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2023-09-18 Jacob Navia <jacob@jacob.remcomp.fr>
* config/tc-riscv.c (riscv_ip_hardcode): Fully initialise the
allocated riscv_opcode structure.
2023-08-17 Jose E. Marchesi <jose.marchesi@oracle.com>
* config/tc-bpf.c (check_immediate_overflow): New function.

View file

@ -3718,7 +3718,7 @@ riscv_ip_hardcode (char *str,
if (*input_line_pointer != '\0')
return _("unrecognized values");
insn = XNEW (struct riscv_opcode);
insn = XCNEW (struct riscv_opcode);
insn->match = values[num - 1];
create_insn (ip, insn);
unsigned int bytes = riscv_insn_length (insn->match);