diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-10-26 14:54:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-26 14:54:25 +0200 |
commit | 32dc763c116999240440b5054798208d97b4c562 (patch) | |
tree | 8348a99862938d5d4ced1b8540c7674522489c1b /src/transports | |
parent | 2bd9b6b67706c8cb84d367f699cc9c48c2719dff (diff) | |
parent | 3b6e006e38ab0c41968f4135104162861fa3f984 (diff) | |
download | libgit2-maint/v0.26.tar.gz |
Merge pull request #4865 from pks-t/pks/v0.26.8v0.26.8maint/v0.26
Release v0.26.8
Diffstat (limited to 'src/transports')
-rw-r--r-- | src/transports/smart.c | 5 | ||||
-rw-r--r-- | src/transports/smart_pkt.c | 2 | ||||
-rw-r--r-- | src/transports/winhttp.c | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/transports/smart.c b/src/transports/smart.c index a96fdf6fb..5cf107dd9 100644 --- a/src/transports/smart.c +++ b/src/transports/smart.c @@ -43,6 +43,11 @@ GIT_INLINE(int) git_smart__reset_stream(transport_smart *t, bool close_subtransp t->current_stream = NULL; } + if (t->url) { + git__free(t->url); + t->url = NULL; + } + if (close_subtransport && t->wrapped->close(t->wrapped) < 0) return -1; diff --git a/src/transports/smart_pkt.c b/src/transports/smart_pkt.c index e726d0777..0e05ff861 100644 --- a/src/transports/smart_pkt.c +++ b/src/transports/smart_pkt.c @@ -391,7 +391,7 @@ static int parse_len(size_t *out, const char *line, size_t linelen) } } - if ((error = git__strtol32(&len, num, &num_end, 16)) < 0) + if ((error = git__strntol32(&len, num, PKT_LEN_SIZE, &num_end, 16)) < 0) return error; if (len < 0) diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c index cf6445f53..c54e16d0f 100644 --- a/src/transports/winhttp.c +++ b/src/transports/winhttp.c @@ -764,7 +764,8 @@ static int winhttp_connect( t->connection = NULL; /* Prepare port */ - if (git__strtol32(&port, t->connection_data.port, NULL, 10) < 0) + if (git__strntol32(&port, t->connection_data.port, + strlen(t->connection_data.port), NULL, 10) < 0) return -1; /* Prepare host */ |