From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 04F8C385117F; Wed, 12 Oct 2022 14:15:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04F8C385117F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665584140; bh=yKoNGuGNXYydy6MajZBFbB31Dtmgq/w3H6aeEaIeszc=; h=From:To:Subject:Date:From; b=o/Xk7FITIBoJ7UB/GU3OtzQwgn+P2uIkNsb4FdXnCJI62/3OPD260F8KjFG1ZpiEM 4ha4rWKema/uq17Ri1ZCxY/CDIpXZ32AjiVUyo72/8vv3FLfbsyVNaJ4svxX45RIVZ 4e5tjpl/eZGssN4bbaZqBhgD6xzs5fBrL0dnyOPE= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] Fix missing NUL terminator in stdio-common/scanf13 test X-Act-Checkin: glibc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: fbc8167346207cce1c8a3217c363fdaf6d5d7f6e X-Git-Newrev: ed157fcccd5dcf2644236084082ebb5159f6cff8 Message-Id: <20221012141540.04F8C385117F@sourceware.org> Date: Wed, 12 Oct 2022 14:15:40 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ed157fcccd5dcf2644236084082ebb5159f6cff8 commit ed157fcccd5dcf2644236084082ebb5159f6cff8 Author: Szabolcs Nagy Date: Tue Oct 11 14:57:16 2022 +0100 Fix missing NUL terminator in stdio-common/scanf13 test sscanf is only defined on nul terminated string input, but '\0' was missing in this test which caused _IO_str_init_static_internal to read OOB on the stack when computing the bounds of the string. Diff: --- stdio-common/scanf13.c | 1 + 1 file changed, 1 insertion(+) diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c index 720224aa05..60aa62a26f 100644 --- a/stdio-common/scanf13.c +++ b/stdio-common/scanf13.c @@ -67,6 +67,7 @@ main (void) buf[2049] = 0x84; buf[2058] = '\t'; buf[2059] = 'a'; + buf[sizeof (buf) - 1] = '\0'; if (sscanf (buf, "%ms%mc", &sp1, &sp2) != 2) FAIL (); else