]> granicus.if.org Git - libevent/commitdiff
Fix a write of uninitialized RAM in regression tests
authorNick Mathewson <nickm@torproject.org>
Sat, 13 Mar 2010 01:38:25 +0000 (20:38 -0500)
committerNick Mathewson <nickm@torproject.org>
Sat, 13 Mar 2010 05:31:14 +0000 (00:31 -0500)
Not actually harmful, but not something we should be doing.

Found by valgrind.

test/regress.c

index f30bdf886cb35d6c2eb0624f9c1ace859b1805e2..96aebc605ef6f17f138259d69a8295895f324f00 100644 (file)
@@ -282,6 +282,8 @@ combined_write_cb(evutil_socket_t fd, short event, void *arg)
        if (len > both->nread)
                len = both->nread;
 
+       memset(buf, 'q', len);
+
        len = write(fd, buf, len);
        if (len == -1)
                fprintf(stderr, "%s: write\n", __func__);