Fix warnings about passing uninitialized buffers into functions

Most of these buffers were never actually inspected, but it's still
bad style.
This commit is contained in:
Nick Mathewson
2017-09-12 21:09:18 -04:00
parent 491b6de168
commit 4ff170d7b1
11 changed files with 32 additions and 14 deletions
+2
View File
@@ -907,6 +907,8 @@ buf_peek_startswith(const buf_t *buf, const char *cmd)
{
char tmp[PEEK_BUF_STARTSWITH_MAX];
size_t clen = strlen(cmd);
if (clen == 0)
return 1;
if (BUG(clen > sizeof(tmp)))
return 0;
if (buf->datalen < clen)
+1
View File
@@ -2580,6 +2580,7 @@ tor_inet_pton(int af, const char *src, void *dst)
int gapPos = -1, i, setWords=0;
const char *dot = strchr(src, '.');
const char *eow; /* end of words. */
memset(words, 0xf8, sizeof(words));
if (dot == src)
return 0;
else if (!dot)