From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 84AB73852C4A; Wed, 23 Nov 2022 14:39:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84AB73852C4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669214396; bh=0DN3L3JmFn9fKunpPYdkLZl56qhlAGhR6xfYn2Q0eXs=; h=From:To:Subject:Date:From; b=CpGmG0fzlwMGbH1vblX3npk2vYhz8AwQSBQUNoe/ST248uPYaaV+LR2tam5ZkHjQK BpAFRkNgYusKmtw+psI3WsLCxsKfiscclAGcwaTDi8T+bxBC1s+bcVLKyfbmyPSn+k aq8glL00IH9cNx6W5nVZxhume52lBEJ1SMRKyWG0= 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: 2a287534c18a37536141e94dc98685a4ce10f89f X-Git-Newrev: 69ecb7b4a3287e814d315e0bab05705be4d9a010 Message-Id: <20221123143956.84AB73852C4A@sourceware.org> Date: Wed, 23 Nov 2022 14:39:56 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=69ecb7b4a3287e814d315e0bab05705be4d9a010 commit 69ecb7b4a3287e814d315e0bab05705be4d9a010 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