summaryrefslogtreecommitdiff
path: root/src/transports
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-10-18 11:58:14 +0200
committerPatrick Steinhardt <ps@pks.im>2018-10-18 11:58:14 +0200
commit2613fbb26a3e1a34dda8a5d198c108626cfd6cc3 (patch)
tree968df61bb825f5d2efc70c1fb2734b42df115732 /src/transports
parent21652ee9de439e042cc2e69b208aa2ef8ce31147 (diff)
downloadlibgit2-2613fbb26a3e1a34dda8a5d198c108626cfd6cc3.tar.gz
global: replace remaining use of `git__strtol32`
Replace remaining uses of the `git__strtol32` function. While these uses are all safe as the strings were either sanitized or from a trusted source, we want to remove `git__strtol32` altogether to avoid future misuse.
Diffstat (limited to 'src/transports')
-rw-r--r--src/transports/smart_pkt.c2
-rw-r--r--src/transports/winhttp.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/transports/smart_pkt.c b/src/transports/smart_pkt.c
index 6a404efe4..fb59c70ec 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 3df892d09..e925dbdc0 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -766,7 +766,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 */