From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DNS_FROM_AHBL_RHSBL,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.0 Date: Sat, 2 Apr 2016 18:36:15 +0200 From: Alexey Gladkov To: Linux console tools development discussion Message-ID: <20160402163615.GC24230@comp-core-i7-2640m-0182e6.brq.redhat.com> References: <20160321104152.654b0d38@pc1> <20160327195922.GA13409@nyan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160327195922.GA13409@nyan> Subject: Re: [kbd] Invalid out of bounds memory read when running make check X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 16:36:08 -0000 Archived-At: List-Archive: On Sun, Mar 27, 2016 at 08:59:22PM +0100, Felix Janda wrote: > Subject: ksyms: Fix out of bounds memory read in codetoksym > > Bug detected by Hanno Böck using asan. > --- > src/libkeymap/ksyms.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libkeymap/ksyms.c b/src/libkeymap/ksyms.c > index 22b1336..3d35ead 100644 > --- a/src/libkeymap/ksyms.c > +++ b/src/libkeymap/ksyms.c > @@ -197,7 +197,7 @@ codetoksym(struct lk_ctx *ctx, int code) { > i = ctx->charset; > while (1) { > p = (sym *) charsets[i].charnames; > - if (p) { > + if (p && (KVAL(code) >= charsets[i].start)) { > p += KVAL(code) - charsets[i].start; > > if (p->name[0]) > -- > 2.7.3 Applied, thanks! -- Rgrds, legion