summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-10-01 11:02:22 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2024-10-02 09:02:40 +0200
commit984ed20ece1c6c20789ece040cbff3eb1a388fa9 (patch)
treedcf96558e01c8e9d45efce307beba21d195fe606 /scripts
parentkconfig: qconf: move conf_read() before drawing tree pain (diff)
downloadlinux-984ed20ece1c6c20789ece040cbff3eb1a388fa9.tar.xz
linux-984ed20ece1c6c20789ece040cbff3eb1a388fa9.zip
kconfig: qconf: fix buffer overflow in debug links
If you enable "Option -> Show Debug Info" and click a link, 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 <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/qconf.cc2
1 files changed, 1 insertions, 1 deletions
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 = url.toEncoded();
const std::size_t count = str.size();
- char *data = new char[count + 1];
+ char *data = new char[count + 2]; // '$' + '\0'
struct symbol **result;
struct menu *m = NULL;