Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6248920ybf; Thu, 5 Mar 2020 16:31:59 -0800 (PST) X-Google-Smtp-Source: ADFU+vs3avbqA11ruqtrrcvAch+2gdrQs6AAdjdidqP1WcTGs3eHNCxnksdi2m0xMMw25uzoIxTJ X-Received: by 2002:a9d:7d04:: with SMTP id v4mr455363otn.308.1583454719760; Thu, 05 Mar 2020 16:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583454719; cv=none; d=google.com; s=arc-20160816; b=lZXUEgT6C+lsJ/97+ZWCMQS4Ej9hXMzcK5oTLoZF6sKVOUXy0f+l1bMowj591tvbpE wlhDQCW23lor64CK63CV2rCx/gX/ZuXGM1G8cit1uBFv5cOqQqIQcjDZ7R0idIfZS6Zo 9jHm3sIH8Y20C05O2EO1FIxyqAZQ00rwDyhTQ3yghJZkr3jcI5kkw8vB6d5UD7yVR/rj xwWVI3n5Zi/9OWGjstPn1K1B8DETS+xKLhTUZLd9w37N9pg4j6I4C6jQxZ0iKuqicoxz wWLLZOdHwoRXVyb/lI/AvZNxvpbbO+ArOEc5eftNU8cWz3bbUKAfi/EsLj1HrKPurzHE OWKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date; bh=IXV+Qe4sVID9v8dMyYFeDigjCfzvQq112GarnN6UX5k=; b=Q/9a0lj5VUkI77vW6SN8+1jUbGw5rISa26hgXwxLwCtqtVZlu3z+37AvKnnPK4ofmt GIoY9FImbSyxW0grwnWe8DY8N+6XW1eQAUgqQzJ4nl8uO+8xx7MXvaNqx6FiacBSVB1R 1m32vGtSPAApOdY5GKMHNqxkwpHGHNays9rC0oAt1fAMrAJZjtd93sVx8wVycvvMk1Yf /s5u86qFrV9GUPYn3l7lhLyNdV4fV4bdiyYsSPy2jzLekWc569DXiXQWpAgUi64DlvpZ 7nygqSsMxnAhMORqtmmoZxx1bQ788ic72O++nQ8D3aB/F71HvbSIFEtZ2476FXLmf2vW O89A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si367415oih.37.2020.03.05.16.31.47; Thu, 05 Mar 2020 16:31:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbgCFAav (ORCPT + 99 others); Thu, 5 Mar 2020 19:30:51 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:37088 "EHLO hera.aquilenet.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726173AbgCFAav (ORCPT ); Thu, 5 Mar 2020 19:30:51 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 9A4E83B0E; Fri, 6 Mar 2020 01:30:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uOTh074kySs1; Fri, 6 Mar 2020 01:30:48 +0100 (CET) Received: from function (lfbn-bor-1-797-11.w86-234.abo.wanadoo.fr [86.234.239.11]) by hera.aquilenet.fr (Postfix) with ESMTPSA id BE5A93AC8; Fri, 6 Mar 2020 01:30:48 +0100 (CET) Received: from samy by function with local (Exim 4.93) (envelope-from ) id 1jA0t5-001u79-U1; Fri, 06 Mar 2020 01:30:47 +0100 Date: Fri, 6 Mar 2020 01:30:47 +0100 From: Samuel Thibault To: akpm@linux-foundation.org Cc: speakup@braille.uwo.ca, linux-kernel@vger.kernel.org Subject: [PATCH] staging/speakup: fix get_word non-space look-ahead Message-ID: <20200306003047.thijtmqrnayd3dmw@function> Mail-Followup-To: Samuel Thibault , akpm@linux-foundation.org, speakup@braille.uwo.ca, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get_char was erroneously given the address of the pointer to the text instead of the address of the text, thus leading to random crashes when the user requests speaking a word while the current position is on a space character and say_word_ctl is not enabled. Cc: stable@vger.kernel.org Reported-on: https://github.com/bytefire/speakup/issues/1 Reported-by: Kirk Reiser Reported-by: Janina Sajka Reported-by: Alexandr Epaneshnikov Reported-by: Gregory Nowak Reported-by: deedra waters Signed-off-by: Samuel Thibault Tested-by: Alexandr Epaneshnikov Tested-by: Gregory Nowak Tested-by: Michael Taboada --- drivers/staging/speakup/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index 488f2539aa9a..81ecfd1a200d 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -561,7 +561,7 @@ static u_long get_word(struct vc_data *vc) return 0; } else if (tmpx < vc->vc_cols - 2 && (ch == SPACE || ch == 0 || (ch < 0x100 && IS_WDLM(ch))) && - get_char(vc, (u_short *)&tmp_pos + 1, &temp) > SPACE) { + get_char(vc, (u_short *)tmp_pos + 1, &temp) > SPACE) { tmp_pos += 2; tmpx++; } else { -- 2.20.1