Fix segfault in vitastor-cli serve without TLS
#85
Reference in New Issue
Block a user
No description provided.
Delete Branch "epicstyt/vitastor:fix-serve-plain-http-segfault"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Serving plain HTTP segfaults on the first accepted connection — zero bytes sent is enough.
http_ctx(src/cmd/cli_serve.cpp:81) is assigned only in the TLS branch, so it stays NULL, andhttp_init()dereferences it unchecked (src/client/http_client.cpp:278). The addedelsebuilds a context with empty cert/key/CA:http_context_initskips all certificate loading andsslstays false.Contributor Name
Stepan Rabotkin
CLA