Skip to content

Commit 3c1b4e5

Browse files
committed
Fixed problem with array allocation for executables array.
MAX_BROWSER_FILES needed to be 5. Also initialized all array entries to NULL before assigning executable names. Signed-off-by: Hans Dijkema <[email protected]>
1 parent 80f8976 commit 3c1b4e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/webui.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6077,9 +6077,14 @@ static bool _webui_custom_browser_exist(_webui_window_t* win, size_t browser) {
60776077
}
60786078
}
60796079
#else
6080-
#define MAX_BROWSER_FILES (2)
6080+
#define MAX_BROWSER_FILES (5)
60816081
char* executable = NULL;
60826082
char* executables[MAX_BROWSER_FILES] = {0};
6083+
{
6084+
int i;
6085+
for(i = 0; i < MAX_BROWSER_FILES; i++)
6086+
executables[i] = NULL;
6087+
}
60836088
if (browser == Chrome) {
60846089
executables[0] = "google-chrome";
60856090
executables[1] = "google-chrome-stable";
@@ -6090,7 +6095,6 @@ static bool _webui_custom_browser_exist(_webui_window_t* win, size_t browser) {
60906095
}
60916096
else if (browser == Epic) {
60926097
executables[0] = "epic";
6093-
executables[1] = NULL;
60946098
}
60956099
else if (browser == Vivaldi) {
60966100
executables[0] = "vivaldi";
@@ -6101,7 +6105,6 @@ static bool _webui_custom_browser_exist(_webui_window_t* win, size_t browser) {
61016105
executables[1] = "brave-browser-stable";
61026106
executables[2] = "brave-browser-nightly";
61036107
executables[3] = "brave-browser-beta";
6104-
executables[4] = NULL;
61056108
}
61066109
else if (browser == Firefox) {
61076110
executables[0] = "firefox";

0 commit comments

Comments
 (0)