From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 01070386185A; Thu, 27 Oct 2022 13:49:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01070386185A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666878598; bh=//dXcYnj+x5CBwI4OXZmRdmRDyRN9Z3ldp9MjopH9Z4=; h=From:To:Subject:Date:From; b=O8arFDHPrBCMg0O+g08AQ9ZRSA3PXCXRsVXuIqvl5THAD/rOV2F9ZmEessG5Y9Oxq bENNq3rZ12wzxR+ucYvMVsoiT/yKLyZtoU8c9gGrFVMtQy0e2qkAna4MwvsKo5xqrR q7caRu5FZ5RMIrfVVxws9HdOQ1Dm7S1v7mcXNSfg= 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: 1dc3098e2c316254d6a9cb50797f2eca9be92b9f X-Git-Newrev: b30fd928ac8f272dccb232cea47233c03f8f142d Message-Id: <20221027134958.01070386185A@sourceware.org> Date: Thu, 27 Oct 2022 13:49:57 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b30fd928ac8f272dccb232cea47233c03f8f142d commit b30fd928ac8f272dccb232cea47233c03f8f142d 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