Commit 984ed20e authored by Masahiro Yamada's avatar Masahiro Yamada

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: c4f7398b ("kconfig: qconf: make debug links work again")
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent da724c33
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment