diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-05-29 09:38:32 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-05-29 09:38:57 -0400 |
commit | 0e0cf4abd80249faa23f2bbdb89e62ba96c898f0 (patch) | |
tree | 82b647f4a512840726410a11e0ec8709fbb4381a /src | |
parent | 0d5a0b4f0ccc804913fbca20acf5fc62f52570b8 (diff) | |
download | tor-0e0cf4abd80249faa23f2bbdb89e62ba96c898f0.tar.gz tor-0e0cf4abd80249faa23f2bbdb89e62ba96c898f0.zip |
Tweak comments in tor_vasprintf(), and add a changes file for 30651
Diffstat (limited to 'src')
-rw-r--r-- | src/common/compat.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index d3bc2f5fec..ee3bf0fd50 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -554,13 +554,16 @@ tor_vasprintf(char **strp, const char *fmt, va_list args) * characters we need. We give it a try on a short buffer first, since * it might be nice to avoid the second vsnprintf call. */ + /* XXXX This code spent a number of years broken (see bug 30651). It is + * possible that no Tor users actually run on systems without vasprintf() or + * _vscprintf(). If so, we should consider removing this code. */ char buf[128]; int len, r; va_list tmp_args; va_copy(tmp_args, args); - /* Use vsnprintf to retrieve needed length. tor_vsnprintf() is not an option - * here because it will simply return -1 if buf is not large enough to hold the - * complete string. + /* Use vsnprintf to retrieve needed length. tor_vsnprintf() is not an + * option here because it will simply return -1 if buf is not large enough + * to hold the complete string. */ len = vsnprintf(buf, sizeof(buf), fmt, tmp_args); va_end(tmp_args); @@ -3550,4 +3553,3 @@ tor_get_avail_disk_space(const char *path) return -1; #endif } - |