X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=nscd.c;h=35502d7bedb175cae7bf863206f75c2594273382;hb=57fd22718b48d3a6c559b0f0e29bc1a1260b26bb;hp=f1c4df84d196a10b9d86b5bddac9edbdf50aa1d4;hpb=1836138cce7db5b3cebce33a516e76ad4a20a5ee;p=unscd.git diff --git a/nscd.c b/nscd.c index f1c4df8..35502d7 100644 --- a/nscd.c +++ b/nscd.c @@ -144,8 +144,10 @@ vda.linux@googlemail.com * 0.49 minor tweaks to messages * 0.50 add more files to watch for changes * 0.51 fix a case where we forget to refcount-- the cached entry + * 0.52 make free_refcounted_ureq() tolerant to pointers to NULLs + * 0.53 fix INVALIDATE and SHUTDOWN requests being ignored */ -#define PROGRAM_VERSION "0.51" +#define PROGRAM_VERSION "0.53" #define DEBUG_BUILD 1 @@ -1213,6 +1215,10 @@ static void free_refcounted_ureq(user_req **ureqp) { user_req *ureq = *ureqp; + /* (when exactly can this happen?) */ + if (ureq == NULL) + return; + if (!CACHED_ENTRY(ureq)) return; @@ -1595,12 +1601,6 @@ static int handle_client(int i) close_client(i); return 0; } - srv = type_to_srv[ureq->type]; - if (!config.srv_enable[srv]) { - log(L_INFO, "service %d is disabled, dropping", srv); - close_client(i); - return 0; - } hex_dump(cinfo[i].ureq, cinfo[i].bytecnt); @@ -1637,6 +1637,13 @@ static int handle_client(int i) return 0; } + srv = type_to_srv[ureq->type]; + if (!config.srv_enable[srv]) { + log(L_INFO, "service %d is disabled, dropping", srv); + close_client(i); + return 0; + } + if (ureq->type != GETHOSTBYADDR && ureq->type != GETHOSTBYADDRv6 ) {