Help clang understand that we aren't dereferencing
authorFabian Keil <fk@fabiankeil.de>
Sun, 1 Mar 2009 18:28:24 +0000 (18:28 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 1 Mar 2009 18:28:24 +0000 (18:28 +0000)
NULL pointers here.

cgi.c
errlog.c
filters.c
jcc.c

diff --git a/cgi.c b/cgi.c
index ef98085..cbeafed 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.113 2008/09/04 08:13:58 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.114 2008/12/04 18:15:04 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
@@ -38,6 +38,9 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.113 2008/09/04 08:13:58 fabiankeil Exp $"
  *
  * Revisions   :
  *    $Log: cgi.c,v $
  *
  * Revisions   :
  *    $Log: cgi.c,v $
+ *    Revision 1.114  2008/12/04 18:15:04  fabiankeil
+ *    Fix some cparser warnings.
+ *
  *    Revision 1.113  2008/09/04 08:13:58  fabiankeil
  *    Prepare for critical sections on Windows by adding a
  *    layer of indirection before the pthread mutex functions.
  *    Revision 1.113  2008/09/04 08:13:58  fabiankeil
  *    Prepare for critical sections on Windows by adding a
  *    layer of indirection before the pthread mutex functions.
@@ -1501,6 +1504,7 @@ struct http_response *error_response(struct client_state *csp,
        * XXX: While the template is called forwarding-failed,
        * it currently only handles socks forwarding failures.
        */
        * XXX: While the template is called forwarding-failed,
        * it currently only handles socks forwarding failures.
        */
+      assert(fwd != NULL);
       assert(fwd->type != SOCKS_NONE);
 
       /*
       assert(fwd->type != SOCKS_NONE);
 
       /*
index 138d7e9..9131987 100644 (file)
--- a/errlog.c
+++ b/errlog.c
@@ -1,4 +1,4 @@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.85 2009/02/06 17:51:38 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.86 2009/02/09 21:21:15 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@ -33,6 +33,11 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.85 2009/02/06 17:51:38 fabiankeil E
  *
  * Revisions   :
  *    $Log: errlog.c,v $
  *
  * Revisions   :
  *    $Log: errlog.c,v $
+ *    Revision 1.86  2009/02/09 21:21:15  fabiankeil
+ *    Now that init_log_module() is called earlier, call show_version()
+ *    later on from main() directly so it doesn't get called for --help
+ *    or --version.
+ *
  *    Revision 1.85  2009/02/06 17:51:38  fabiankeil
  *    Be prepared if I break the log module initialization again.
  *
  *    Revision 1.85  2009/02/06 17:51:38  fabiankeil
  *    Be prepared if I break the log module initialization again.
  *
@@ -1053,6 +1058,7 @@ void log_error(int loglevel, const char *fmt, ...)
             "%s %08lx Fatal error: Out of memory in log_error().",
             timestamp, thread_id);
          fatal_error(tempbuf); /* Exit */
             "%s %08lx Fatal error: Out of memory in log_error().",
             timestamp, thread_id);
          fatal_error(tempbuf); /* Exit */
+         return;
       }
    }
    outbuf = outbuf_save;
       }
    }
    outbuf = outbuf_save;
index 5e26f50..99aa5c7 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.110 2008/11/10 16:40:25 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.111 2008/12/04 18:13:46 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -40,6 +40,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.110 2008/11/10 16:40:25 fabiankei
  *
  * Revisions   :
  *    $Log: filters.c,v $
  *
  * Revisions   :
  *    $Log: filters.c,v $
+ *    Revision 1.111  2008/12/04 18:13:46  fabiankeil
+ *    Fix a cparser warning.
+ *
  *    Revision 1.110  2008/11/10 16:40:25  fabiankeil
  *    Fix a gcc44 warning.
  *
  *    Revision 1.110  2008/11/10 16:40:25  fabiankeil
  *    Fix a gcc44 warning.
  *
@@ -2475,6 +2478,7 @@ const static struct forward_spec *get_forward_override_settings(struct client_st
       log_error(LOG_LEVEL_FATAL,
          "can't allocate memory for forward-override{%s}", forward_override_line);
       /* Never get here - LOG_LEVEL_FATAL causes program exit */
       log_error(LOG_LEVEL_FATAL,
          "can't allocate memory for forward-override{%s}", forward_override_line);
       /* Never get here - LOG_LEVEL_FATAL causes program exit */
+      return NULL;
    }
 
    vec_count = ssplit(forward_settings, " \t", vec, SZ(vec), 1, 1);
    }
 
    vec_count = ssplit(forward_settings, " \t", vec, SZ(vec), 1, 1);
diff --git a/jcc.c b/jcc.c
index c193898..414e5fc 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.224 2009/02/14 15:32:04 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.225 2009/02/19 18:09:32 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -33,6 +33,10 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.224 2009/02/14 15:32:04 fabiankeil Exp $"
  *
  * Revisions   :
  *    $Log: jcc.c,v $
  *
  * Revisions   :
  *    $Log: jcc.c,v $
+ *    Revision 1.225  2009/02/19 18:09:32  fabiankeil
+ *    Unbreak build without FEATURE_CONNECTION_KEEP_ALIVE.
+ *    Noticed by David.
+ *
  *    Revision 1.224  2009/02/14 15:32:04  fabiankeil
  *    Add the request URL to the timeout message in chat().
  *    Suggested by Lee.
  *    Revision 1.224  2009/02/14 15:32:04  fabiankeil
  *    Add the request URL to the timeout message in chat().
  *    Suggested by Lee.
@@ -2591,6 +2595,7 @@ static void chat(struct client_state *csp)
    {
       log_error(LOG_LEVEL_FATAL, "gateway spec is NULL!?!?  This can't happen!");
       /* Never get here - LOG_LEVEL_FATAL causes program exit */
    {
       log_error(LOG_LEVEL_FATAL, "gateway spec is NULL!?!?  This can't happen!");
       /* Never get here - LOG_LEVEL_FATAL causes program exit */
+      return;
    }
 
    /*
    }
 
    /*