[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r13597: is_reverse in our struct is uint8_t. don't make it be an int (tor/trunk/src/or)
Author: arma
Date: 2008-02-19 18:14:34 -0500 (Tue, 19 Feb 2008)
New Revision: 13597
Modified:
tor/trunk/src/or/dns.c
Log:
is_reverse in our struct is uint8_t. don't make it be an int
elsewhere. bug reported by veracode.
Modified: tor/trunk/src/or/dns.c
===================================================================
--- tor/trunk/src/or/dns.c 2008-02-19 23:05:56 UTC (rev 13596)
+++ tor/trunk/src/or/dns.c 2008-02-19 23:14:34 UTC (rev 13597)
@@ -90,7 +90,7 @@
} cached_resolve_t;
static void purge_expired_resolves(time_t now);
-static void dns_found_answer(const char *address, int is_reverse,
+static void dns_found_answer(const char *address, uint8_t is_reverse,
uint32_t addr, const char *hostname, char outcome,
uint32_t ttl);
static void send_resolved_cell(edge_connection_t *conn, uint8_t answer_type);
@@ -620,7 +620,8 @@
pending_connection_t *pending_connection;
struct in_addr in;
time_t now = time(NULL);
- int is_reverse = 0, r;
+ uint8_t is_reverse = 0;
+ int r;
assert_connection_ok(TO_CONN(exitconn), 0);
tor_assert(exitconn->_base.s == -1);
assert_cache_ok();
@@ -900,7 +901,7 @@
* DNS_RESOLVE_{FAILED_TRANSIENT|FAILED_PERMANENT|SUCCEEDED}.
**/
static void
-add_answer_to_cache(const char *address, int is_reverse, uint32_t addr,
+add_answer_to_cache(const char *address, uint8_t is_reverse, uint32_t addr,
const char *hostname, char outcome, uint32_t ttl)
{
cached_resolve_t *resolve;
@@ -953,7 +954,7 @@
* DNS_RESOLVE_{FAILED_TRANSIENT|FAILED_PERMANENT|SUCCEEDED}.
*/
static void
-dns_found_answer(const char *address, int is_reverse, uint32_t addr,
+dns_found_answer(const char *address, uint8_t is_reverse, uint32_t addr,
const char *hostname, char outcome, uint32_t ttl)
{
pending_connection_t *pend;
@@ -1178,7 +1179,7 @@
void *arg)
{
char *string_address = arg;
- int is_reverse = 0;
+ uint8_t is_reverse = 0;
int status = DNS_RESOLVE_FAILED_PERMANENT;
uint32_t addr = 0;
const char *hostname = NULL;