1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00:00

Fix string overflow in bookmarks/bookmarks.c

elinks_ulongcat requires an extra byte for trailing \0
This commit is contained in:
Vladislav Zavjalov 2021-11-22 18:04:00 +00:00 committed by Witold Filipczyk
parent 9dca06c604
commit c7338c632c

View File

@ -624,11 +624,11 @@ bookmark_all_terminals(struct bookmark *folder)
}
foreach (term, terminals) {
char subfoldername[4];
char subfoldername[5];
struct bookmark *subfolder;
if (ulongcat(subfoldername, NULL, n, sizeof(subfoldername), 0)
>= sizeof(subfoldername))
if (ulongcat(subfoldername, NULL, n, sizeof(subfoldername)-1, 0)
>= sizeof(subfoldername)-1)
return;
++n;