From 99dc63b10b3878616b85df2dfd2e4e7103e414b8 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 19 Oct 2019 14:01:30 +0200 Subject: libcpu: Fix bounds checks and replace asserts with errors. Add a missing bounds check, fix an off-by-one bounds check and replace asserts with error messages. https://sourceware.org/bugzilla/show_bug.cgi?id=25068 Signed-off-by: Mark Wielaard --- libcpu/i386_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcpu/i386_data.h') diff --git a/libcpu/i386_data.h b/libcpu/i386_data.h index b8a34c3e..06356b8a 100644 --- a/libcpu/i386_data.h +++ b/libcpu/i386_data.h @@ -1336,7 +1336,7 @@ FCT_sel (struct output_data *d) { assert (d->opoff1 % 8 == 0); assert (d->opoff1 / 8 == 5); - if (*d->param_start + 2 > d->end) + if (*d->param_start + 2 >= d->end) return -1; *d->param_start += 2; uint16_t absval = read_2ubyte_unaligned (&d->data[5]); -- cgit v1.2.3