Skip to content

Commit

Permalink
kconfig: qconf: fix buffer overflow in debug links
Browse files Browse the repository at this point in the history
[ Upstream commit 984ed20 ]

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: c4f7398 ("kconfig: qconf: make debug links work again")
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
masahir0y authored and thangqn-ampere committed Nov 11, 2024
1 parent 824ec06 commit e4618b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,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;

Expand Down

0 comments on commit e4618b7

Please sign in to comment.