]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Never use sprintf. tor_snprintf instead. Bug in tests, not in any released tor.
authorNick Mathewson <nickm@torproject.org>
Tue, 22 Mar 2016 12:52:17 +0000 (08:52 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 Mar 2016 12:52:17 +0000 (08:52 -0400)
src/test/test_dir_handle_get.c

index d74aeb611093544add768928a45094b489a4acda..05657ca45205bdcb47d2440b56a81e54829b6c6f 100644 (file)
@@ -255,7 +255,7 @@ test_dir_handle_get_bytes_txt(void *data)
   tt_assert(strstr(header, "Content-Encoding: identity\r\n"));
   tt_assert(strstr(header, "Pragma: no-cache\r\n"));
 
-  sprintf(buff, "Content-Length: %ld\r\n", (long) body_len);
+  tor_snprintf(buff, sizeof(buff), "Content-Length: %ld\r\n", (long) body_len);
   tt_assert(strstr(header, buff));
 
   tt_int_op(body_used, OP_EQ, strlen(body));