From: phk Date: Tue, 1 Aug 2006 16:42:37 +0000 (+0000) Subject: More miniobj checks X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a41838524dc4f312bf503a50fcb91e82ebb3dc1c;p=varnish More miniobj checks git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@591 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 2660d695..9080d032 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -49,6 +49,7 @@ vca_tick(int a, short b, void *c) AZ(evtimer_add(&tick_e, &tick_rate)); clock_gettime(CLOCK_MONOTONIC, &t); TAILQ_FOREACH_SAFE(sp, &sesshead, list, sp2) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); if (sp->t_idle.tv_sec + 30 < t.tv_sec) { TAILQ_REMOVE(&sesshead, sp, list); vca_close_session(sp, "timeout"); @@ -60,8 +61,9 @@ vca_tick(int a, short b, void *c) static void vca_callback(void *arg, int bad) { - struct sess *sp = arg; + struct sess *sp; + CAST_OBJ_NOTNULL(sp, arg, SESS_MAGIC); TAILQ_REMOVE(&sesshead, sp, list); if (bad) { if (bad == 1) diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index 949fe1bf..13a4ae8f 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -446,12 +446,13 @@ http_header_complete(struct http *hp) static void http_read_f(int fd, short event, void *arg) { - struct http *hp = arg; + struct http *hp; unsigned l; int i, ret = 0; (void)event; + CAST_OBJ_NOTNULL(hp, arg, HTTP_MAGIC); l = (hp->e - hp->s) / 2; if (l < hp->v - hp->s) l = 0; diff --git a/varnish-cache/bin/varnishd/flint.lnt b/varnish-cache/bin/varnishd/flint.lnt index 9ac3c660..f6933097 100644 --- a/varnish-cache/bin/varnishd/flint.lnt +++ b/varnish-cache/bin/varnishd/flint.lnt @@ -1,4 +1,4 @@ --passes=3 +-passes=12 // Fix strchr() semtics, it can only return NULL if arg2 != 0 -sem(strchr, 1p, type(1), 2n == 0 ? (@p < 1p) : (@p < 1p || @p == 0 ))