Skip to content

Commit 984ed20

Browse files
committed
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: c4f7398 ("kconfig: qconf: make debug links work again") Signed-off-by: Masahiro Yamada <[email protected]>
1 parent da724c3 commit 984ed20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/kconfig/qconf.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void ConfigInfoView::clicked(const QUrl &url)
11661166
{
11671167
QByteArray str = url.toEncoded();
11681168
const std::size_t count = str.size();
1169-
char *data = new char[count + 1];
1169+
char *data = new char[count + 2]; // '$' + '\0'
11701170
struct symbol **result;
11711171
struct menu *m = NULL;
11721172

0 commit comments

Comments
 (0)