Skip to content

Commit a3d2922

Browse files
committed
httpclient: safety
1 parent 5a13d4c commit a3d2922

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libgit2/transports/httpclient.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,11 @@ GIT_INLINE(int) server_setup_from_url(
837837
git_http_server *server,
838838
git_net_url *url)
839839
{
840+
GIT_ASSERT_ARG(url);
841+
GIT_ASSERT_ARG(url->scheme);
842+
GIT_ASSERT_ARG(url->host);
843+
GIT_ASSERT_ARG(url->port);
844+
840845
if (!server->url.scheme || strcmp(server->url.scheme, url->scheme) ||
841846
!server->url.host || strcmp(server->url.host, url->host) ||
842847
!server->url.port || strcmp(server->url.port, url->port)) {

0 commit comments

Comments
 (0)