From nobody Thu Nov 28 12:43:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E354519ABCB; Tue, 1 Oct 2024 09:02:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727773354; cv=none; b=rPgNNCKj8Y2c3m3Snm/VpPVafVpZ697XY8gqoesxg+gRTxtq8IyOIgQPRADIn9bipaD2My+UT4U8Epe/ZiGm1Mq1AsAgjJ2G5SF74kN1+dCJfoi2kKbvTBuq5njJng9xClrk58/gzqkC/Gh9Mjjic/IBAE289gnKZyF6vdwL/6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727773354; c=relaxed/simple; bh=6bf5fSHj60t3k4yhPDUaRPovE0nur9YRMmZw68ogcyU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tAXLh4feRMgB6K67YHAdCE23CxBIJTYKqRaYbexMyf+v30DDTwZHDryhv56rUeWr5YRhCgbXuoRn8uQL0Vb2pMibbhiKE4J42e/RK+H95BtylMuExV99OYUMqeBnGNdnS2r6EvyFl1q/WA8vu27RPFQfZ7Zt7vYkowTo2SktBmA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A4ubeKcR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A4ubeKcR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F075C4CEC6; Tue, 1 Oct 2024 09:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727773353; bh=6bf5fSHj60t3k4yhPDUaRPovE0nur9YRMmZw68ogcyU=; h=From:To:Cc:Subject:Date:From; b=A4ubeKcRZU2j6ThTxZUlFYodHpwGp/gsahSoDaeouA+16K8/I2wTIg+cdviIb7Z2a SG4EMlY16FMVnjykuSHWX48SRKAsZ4Q7ApQmYYJO/yiLkvlRnLDki5C9mBc8XY/BWT Mb95xqE0JdZ8PanrSeDIAtCWUM+rzRjTVmr+D5eBn2b5ARiuREzP/K5I6zjbiwnhnB XKb3FsHbP4fDuL7oItv1PIchypmY44Jgc/TZkkSt4ZWkX3vK5LFHdgLIkrbFHTR+Vk h67HQyOOtXo8g6wjlGVr25Ty7tNdXUZXLRZ7OLj3knXPtBpjaj1CthioUJRl8m7CMF 1dVzvjqUMW2XQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Mauro Carvalho Chehab Subject: [PATCH] kconfig: qconf: fix buffer overflow in debug links Date: Tue, 1 Oct 2024 18:02:22 +0900 Message-ID: <20241001090226.2784447-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If you enable the "Option -> Show Debug Info" and click a click, the program terminates with the following error: *** buffer overflow detected ***: terminated The buffer overflow is caused by the following line: strcat(data, "$"); The buffer needs one more byte to accommodate the additional character. Fixes: c4f7398bee9c ("kconfig: qconf: make debug links work again") Signed-off-by: Masahiro Yamada --- scripts/kconfig/qconf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 7dba8014ead4..e260cab1c2af 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1166,7 +1166,7 @@ void ConfigInfoView::clicked(const QUrl &url) { QByteArray str =3D url.toEncoded(); const std::size_t count =3D str.size(); - char *data =3D new char[count + 1]; + char *data =3D new char[count + 2]; // '$' + '\0' struct symbol **result; struct menu *m =3D NULL; =20 --=20 2.43.0