mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
maybe appease the overflow detectors more
svn:r13663
This commit is contained in:
parent
daefbfe691
commit
1cd90948ab
@ -292,7 +292,6 @@ DECLARE_MAP_FNS(digestmap_t, const char *, digestmap_);
|
||||
MAP_FOREACH_MODIFY(strmap_, map, const char *, keyvar, valtype, valvar)
|
||||
#define STRMAP_FOREACH_END MAP_FOREACH_END
|
||||
|
||||
|
||||
void* strmap_set_lc(strmap_t *map, const char *key, void *val);
|
||||
void* strmap_get_lc(const strmap_t *map, const char *key);
|
||||
void* strmap_remove_lc(strmap_t *map, const char *key);
|
||||
|
@ -842,8 +842,8 @@ client_dns_incr_failures(const char *address)
|
||||
ent->expires = time(NULL) + MAX_DNS_ENTRY_AGE;
|
||||
strmap_set(addressmap,address,ent);
|
||||
}
|
||||
if (++ent->num_resolve_failures < 0) /* overflow. */
|
||||
ent->num_resolve_failures = SHORT_MAX;
|
||||
if (ent->num_resolve_failures < SHORT_MAX)
|
||||
++ent->num_resolve_failures; /* don't overflow */
|
||||
log_info(LD_APP, "Address %s now has %d resolve failures.",
|
||||
safe_str(address), ent->num_resolve_failures);
|
||||
return ent->num_resolve_failures;
|
||||
|
Loading…
Reference in New Issue
Block a user