diff options
| author | Masahiro Yamada <masahiroy@kernel.org> | 2024-10-01 12:02:22 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-17 16:22:03 +0300 |
| commit | 064debdc4127f5c45727d62a534dc0f1c5b3fcc5 (patch) | |
| tree | cdeffaf1abe5f048979ed53d6bea23e55130e9d8 /scripts | |
| parent | 90ebc392ade3dc664f35581483bb94cdbfb1947c (diff) | |
| download | linux-064debdc4127f5c45727d62a534dc0f1c5b3fcc5.tar.xz | |
kconfig: qconf: fix buffer overflow in debug links
[ Upstream commit 984ed20ece1c6c20789ece040cbff3eb1a388fa9 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/qconf.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 78087b2d9ac6..61b679f6c2f2 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1172,7 +1172,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; |
