Skip to content

Commit 3e39d09

Browse files
committed
fix: explicitly check if return of strstr is NULL pointer
1 parent 42b20c2 commit 3e39d09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/appimagetool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,14 +916,14 @@ main (int argc, char *argv[])
916916
printf("Running on GitHub Actions\n");
917917
gchar *zsyncmake_path = g_find_program_in_path ("zsyncmake");
918918
if (zsyncmake_path) {
919-
if (strstr(github_ref, "/pull/")) {
919+
if (strstr(github_ref, "/pull/") != NULL) {
920920
printf("Will not calculate update information for GitHub because this is a pull request\n");
921921
} else {
922922
printf("Guessing update information based on $GITHUB_REPOSITORY=%s and $GITHUB_REF=%s\n", github_repository, github_ref);
923923
char buf[1024];
924924
gchar **parts = g_strsplit (github_repository, "/", 2);
925925
char* channel;
926-
if (strcmp(github_ref, "") != 0 && strstr(github_ref, "/continuous/")) {
926+
if (strcmp(github_ref, "") != 0 && strstr(github_ref, "/continuous/") != NULL) {
927927
channel = "latest";
928928
} else {
929929
channel = "continuous";

0 commit comments

Comments
 (0)