diff options
| author | Mark Wielaard <[email protected]> | 2020-06-11 23:16:21 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2020-06-11 23:16:21 +0200 |
| commit | 50a6eeef7d87623faa65126dc3d16c2a8e613aea (patch) | |
| tree | 19a35135efaac56c49a30316c6572c7b4d6ec4aa /libcpu/i386_disasm.c | |
| parent | 49f13584d60322578c19b6118393ab04236ca7bf (diff) | |
| parent | a2bc0214a5615551d89cef8d160bdbaafd5f1a83 (diff) | |
Merge tag 'elfutils-0.180' into mjw/RH-DTSdts-0.180
elfutils 0.180 release
Diffstat (limited to 'libcpu/i386_disasm.c')
| -rw-r--r-- | libcpu/i386_disasm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c index 4422ffa2..32df8cd0 100644 --- a/libcpu/i386_disasm.c +++ b/libcpu/i386_disasm.c @@ -407,7 +407,8 @@ i386_disasm (Ebl *ebl __attribute__((unused)), ++curr; - assert (last_prefix_bit != 0); + if (last_prefix_bit == 0) + goto invalid_op; correct_prefix = last_prefix_bit; } @@ -445,8 +446,8 @@ i386_disasm (Ebl *ebl __attribute__((unused)), the input data. */ goto do_ret; - assert (correct_prefix == 0 - || (prefixes & correct_prefix) != 0); + if (correct_prefix != 0 && (prefixes & correct_prefix) == 0) + goto invalid_op; prefixes ^= correct_prefix; if (0) @@ -473,7 +474,8 @@ i386_disasm (Ebl *ebl __attribute__((unused)), if (data == end) { - assert (prefixes != 0); + if (prefixes == 0) + goto invalid_op; goto print_prefix; } @@ -1125,6 +1127,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)), } /* Invalid (or at least unhandled) opcode. */ + invalid_op: if (prefixes != 0) goto print_prefix; /* Make sure we get past the unrecognized opcode if we haven't yet. */ |
