]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
src/common/compat.c:tor_vasprintf() - changed vsnprintf() to tor_vsnprintf() which...
authorJeremy <jeremy@sturgix.com>
Tue, 1 Dec 2015 17:27:29 +0000 (12:27 -0500)
committerJeremy <jeremy@sturgix.com>
Tue, 1 Dec 2015 17:27:29 +0000 (12:27 -0500)
src/common/compat.c

index 7d72b4b7fd950cd596644fe6a5cac242f0a5ed6e..6f357530a6b9193e46cfcaf52b1b45b910f0313a 100644 (file)
@@ -580,7 +580,8 @@ tor_vasprintf(char **strp, const char *fmt, va_list args)
     return len;
   }
   strp_tmp = tor_malloc(len+1);
-  r = vsnprintf(strp_tmp, len+1, fmt, args);
+  /* use of tor_vsnprintf() will ensure string is null terminated */
+  r = tor_vsnprintf(strp_tmp, len+1, fmt, args);
   if (r != len) {
     tor_free(strp_tmp);
     *strp = NULL;