Fix potential "strlen(NULL)"
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 38s

This commit is contained in:
Stephen Seo 2024-09-10 21:18:10 +09:00
parent 57c0812c24
commit 051be910f3

View file

@ -392,8 +392,8 @@ int main(int argc, char **argv) {
} else {
const char *response = c_simple_http_response_code_error_to_response(
response_code);
size_t response_size = strlen(response);
if (response) {
response_size = strlen(response);
CHECK_ERROR_WRITE(write(connection_fd, response, response_size));
} else {
CHECK_ERROR_WRITE(write(