From ea518fa00b8860c538ed6e61e6a54e51281119f4 Mon Sep 17 00:00:00 2001 From: pancake Date: Sun, 12 Feb 2017 19:27:17 +0100 Subject: [PATCH] Fix #6673 - Fix oob read in omf bin plugin --- libr/bin/p/bin_omf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libr/bin/p/bin_omf.c b/libr/bin/p/bin_omf.c index 4056ca48c4242..0bb0334fa40ca 100644 --- a/libr/bin/p/bin_omf.c +++ b/libr/bin/p/bin_omf.c @@ -31,7 +31,7 @@ static int destroy(RBinFile *arch) { static int check_bytes(const ut8 *buf, ut64 length) { int i; - if (!buf) { + if (!buf || length < 4) { return false; } if ((*buf != 0x80 && *buf != 0x82) || length < 4) {