From b788f20d11ff0aef92c7400d8530c5961ea74541 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 27 Sep 2019 23:51:18 +0200 Subject: Fix out of bounds check in lzo_compressor_create Signed-off-by: David Oberhollenzer --- lib/sqfs/comp/lzo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sqfs/comp/lzo.c b/lib/sqfs/comp/lzo.c index 498c250..46f9301 100644 --- a/lib/sqfs/comp/lzo.c +++ b/lib/sqfs/comp/lzo.c @@ -185,7 +185,7 @@ sqfs_compressor_t *lzo_compressor_create(const sqfs_compressor_config_t *cfg) if (cfg->flags & ~SQFS_COMP_FLAG_GENERIC_ALL) return NULL; - if (cfg->opt.lzo.algorithm > LZO_NUM_ALGS || + if (cfg->opt.lzo.algorithm >= LZO_NUM_ALGS || lzo_algs[cfg->opt.lzo.algorithm].compress == NULL) { return NULL; } -- cgit v1.2.3