Skip to content
Snippets Groups Projects
Commit e3da5ad6 authored by teor (Tim Wilson-Brown)'s avatar teor (Tim Wilson-Brown) Committed by Nick Mathewson
Browse files

Replace incorrect use of snprintf in unit tests with tor_snprintf

This avoids a potential out of bounds write.
parent f7b2ae91
No related branches found
No related tags found
No related merge requests found
......@@ -1808,9 +1808,10 @@ test_tortls_debug_state_callback(void *ignored)
tor_tls_debug_state_callback(ssl, 32, 45);
n = snprintf(buf, 1000, "SSL %p is now in state unknown"
n = tor_snprintf(buf, 1000, "SSL %p is now in state unknown"
" state [type=32,val=45].\n", ssl);
buf[n]='\0';
/* tor's snprintf returns -1 on error */
tt_int_op(n, OP_NE, -1);
expect_log_msg(buf);
done:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment