summaryrefslogtreecommitdiff
path: root/src/transports
diff options
context:
space:
mode:
Diffstat (limited to 'src/transports')
-rw-r--r--src/transports/smart.c5
-rw-r--r--src/transports/smart_pkt.c2
-rw-r--r--src/transports/winhttp.c3
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 */