From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26438 invoked by alias); 20 May 2019 20:14:09 -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 26428 invoked by uid 89); 20 May 2019 20:14:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=****, 48000000000, 48.000000000, screen 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; Mon, 20 May 2019 20:14:07 +0000 Received: from mpv5-2015.CWRU.Edu (EHLO mpv5-2015.case.edu) ([129.22.103.234]) by mpv3-2015.case.edu (MOS 4.4.8-GA FastPath queued) with ESMTP id AXT78747; Mon, 20 May 2019 16:14:02 -0400 (EDT) Received: from caleb.INS.CWRU.Edu (EHLO caleb.ins.cwru.edu) ([129.22.8.211]) by mpv5-2015.case.edu (MOS 4.4.8-GA FastPath queued) with ESMTP id CRS61174 (AUTH cpr); Mon, 20 May 2019 16:14:01 -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: Mon, 20 May 2019 20:14: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: <79173bd4-f37e-c137-cf48-187047078bf0@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Junkmail-PrAS-Raw: score=10/90, refid=2.7.2:2019.5.20.194516: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, __NO_HTML_TAG_RAW, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_1000_1099, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, IN_REP_TO, MSG_THREAD, [TRUNCATED], so=2010-03-03 19:42:08, dmn=2016-08-03-0138 X-SW-Source: 2019-05/txt/msg00463.txt.bz2 On 5/17/19 10:59 AM, Tom de Vries wrote: > Either way, I'm open for suggestions that make gdb call > rl_set_screen_size with legal parameters, and disable features like > horizontal scrolling to get unformatted output for the testsuite run. Here's a patch that will prevent the huge values for the screen width from causing at least one issue with line_size: *** ../readline-8.0-patched/display.c 2018-09-30 21:37:48.000000000 -0400 --- display.c 2019-05-16 16:50:44.000000000 -0400 *************** *** 604,607 **** --- 604,610 ---- register int n; + if (line_size <= _rl_screenwidth) /* XXX - for gdb */ + line_size = _rl_screenwidth + 1; + if (invisible_line == 0) /* initialize it */ { You're still going to have to deal with some horizontal scrolling if the input line gets long enough. -- ``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/