Skip to content

Commit 45594ed

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents a6545d6 + 029c941 commit 45594ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

supervisor/shared/web_workflow/web_workflow.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,12 @@ static bool _origin_ok(_request *request) {
478478
return true;
479479
}
480480
// DEBUG: OK if origin is 'localhost' (ignoring port #)
481-
*strchrnul(&request->origin[PREFIX_HTTP_LEN], ':') = '\0';
481+
char *cptr = strchrnul(&request->origin[PREFIX_HTTP_LEN], ':');
482+
char csave = *cptr; // NULL or colon
483+
*cptr = '\0';
482484
if (strcmp(&request->origin[PREFIX_HTTP_LEN], "localhost") == 0) {
485+
// Restore removed colon if non-null host terminator
486+
*cptr = csave;
483487
return true;
484488
}
485489
}

0 commit comments

Comments
 (0)