diff options
| author | Patrick Steinhardt <ps@pks.im> | 2018-10-18 12:04:07 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2018-10-18 12:04:07 +0200 |
| commit | 8d7fa88a9d5011b653035497b0f523e0f177b6a6 (patch) | |
| tree | 6dd65abfe18ccb824438b2adb1acd77f7087f012 /src | |
| parent | 2613fbb26a3e1a34dda8a5d198c108626cfd6cc3 (diff) | |
| download | libgit2-8d7fa88a9d5011b653035497b0f523e0f177b6a6.tar.gz | |
util: remove `git__strtol32`
The function `git__strtol32` can easily be misused when untrusted data
is passed to it that may not have been sanitized with trailing `NUL`
bytes. As all usages of this function have now been removed, we can
remove this function altogether to avoid future misuse of it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/util.c | 6 | ||||
| -rw-r--r-- | src/util.h | 1 |
2 files changed, 0 insertions, 7 deletions
diff --git a/src/util.c b/src/util.c index 099a28a2a..96276ab3e 100644 --- a/src/util.c +++ b/src/util.c @@ -150,12 +150,6 @@ Return: return 0; } -int git__strtol32(int32_t *result, const char *nptr, const char **endptr, int base) -{ - - return git__strntol32(result, nptr, (size_t)-1, endptr, base); -} - int git__strntol32(int32_t *result, const char *nptr, size_t nptr_len, const char **endptr, int base) { int error; diff --git a/src/util.h b/src/util.h index 646631bcf..400024373 100644 --- a/src/util.h +++ b/src/util.h @@ -58,7 +58,6 @@ GIT_INLINE(int) git__signum(int val) return ((val > 0) - (val < 0)); } -extern int git__strtol32(int32_t *n, const char *buff, const char **end_buf, int base); extern int git__strntol32(int32_t *n, const char *buff, size_t buff_len, const char **end_buf, int base); extern int git__strntol64(int64_t *n, const char *buff, size_t buff_len, const char **end_buf, int base); |
