From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1017 invoked by alias); 23 May 2019 12:38:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1009 invoked by uid 89); 23 May 2019 12:38:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=brevis, UD:tiswww.cwru.edu, hippocrates, cwru X-HELO: mpv3-2015.case.edu Received: from mpv3-2015.CWRU.Edu (HELO mpv3-2015.case.edu) (129.22.103.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 May 2019 12:38:19 +0000 Received: from mpv6-2015.CWRU.Edu (EHLO mpv6-2015.case.edu) ([129.22.103.202]) by mpv3-2015.case.edu (MOS 4.4.8-GA FastPath queued) with ESMTP id AXV04474; Thu, 23 May 2019 08:38:13 -0400 (EDT) Received: from caleb.INS.CWRU.Edu (EHLO caleb.ins.cwru.edu) ([129.22.8.211]) by mpv6-2015.case.edu (MOS 4.4.8-GA FastPath queued) with ESMTP id CSY87097 (AUTH cpr); Thu, 23 May 2019 08:38:12 -0400 (EDT) Reply-To: chet.ramey@case.edu Cc: chet.ramey@case.edu, gdb-patches@sourceware.org, Pedro Alves Subject: Re: [Bug-readline] heap-buffer-overflow in update_line To: Tom de Vries , bug-readline@gnu.org References: <52f237e9-83e8-2a97-4766-e60b867ab914@suse.de> <79173bd4-f37e-c137-cf48-187047078bf0@suse.de> From: Chet Ramey Openpgp: preference=signencrypt Message-ID: Date: Thu, 23 May 2019 12:38:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Junkmail-PrAS-Raw: score=10/90, refid=2.7.2:2019.5.23.114216:17:10.433, ip=, rules=__HAS_REPLYTO, __HAS_CC_HDR, __MULTIPLE_RCPTS_CC_X2, __CC_NAME, __CC_NAME_DIFF_FROM_ACC, __SUBJ_REPLY, __PHISH_SPEAR_SUBJ_PREDICATE, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __TO_MALFORMED_2, __TO_NAME, __TO_NAME_DIFF_FROM_ACC, __HAS_REFERENCES, __REFERENCES, __HAS_FROM, FROM_EDU_TLD, __HAS_MSGID, __SANE_MSGID, DATE_TZ_NA, __USER_AGENT, __MOZILLA_USER_AGENT, __MIME_VERSION, __IN_REP_TO, __CT, __CT_TEXT_PLAIN, __CTE, __REPLYTO_SAMEAS_FROM_ADDY, __REPLYTO_SAMEAS_FROM_ACC, __FROM_DOMAIN_IN_ANY_CC2, __TO_IN_SUBJECT2, __REPLYTO_SAMEAS_FROM_DOMAIN, __ANY_URI, __URI_WITH_PATH, __URI_NO_WWW, __CP_URI_IN_BODY, __SUBJ_ALPHA_NEGATE, __URI_IN_BODY, __URI_NOT_IMG, __FORWARDED_MSG, __NO_HTML_TAG_RAW, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_800_899, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, IN_REP_TO, [TRUNCATED], so=2010-03-03 19:42:08, dmn=2016-08-03-0138 X-SW-Source: 2019-05/txt/msg00534.txt.bz2 On 5/23/19 3:33 AM, Tom de Vries wrote: > Using this additional bit: > ... > @@ -528,6 +533,8 @@ rl_redisplay () > init_line_structures (0); > rl_on_new_line (); > } > + else if (line_size <= _rl_screenwidth) > + init_line_structures (_rl_screenwidth + 1); > > /* Draw the line into the buffer. */ > cpos_buffer_position = -1; > ... > I managed to fix the assert also in this scenario, and managed to run > the entire gdb testsuite without triggering the assert. > > Is that a good code change? It looks like it will solve that problem, and perhaps more. Thanks for the patch. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/