mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user