Handle integer overflow in uid counter. Fixes rare crashes in cache code.

This commit is contained in:
Simon Kelley
2014-03-16 22:56:58 +00:00
parent 0c8584eabc
commit 3f7483e816
4 changed files with 23 additions and 16 deletions

View File

@@ -367,7 +367,7 @@ struct crec {
struct crec *cache;
struct interface_name *int_name;
} target;
int uid; /* -1 if union is interface-name */
unsigned int uid; /* 0 if union is interface-name */
} cname;
struct {
struct blockdata *keydata;
@@ -388,7 +388,7 @@ struct crec {
} addr;
time_t ttd; /* time to die */
/* used as class if DNSKEY/DS/RRSIG, index to source for F_HOSTS */
int uid;
unsigned int uid;
unsigned short flags;
union {
char sname[SMALLDNAME];