on platforms where sizeof(int) < sizeof(long).
-const char actions_rcs[] = "$Id: actions.c,v 1.54 2008/09/20 10:04:33 fabiankeil Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.55 2008/12/04 18:18:56 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.c,v $
*
* Revisions :
* $Log: actions.c,v $
+ * Revision 1.55 2008/12/04 18:18:56 fabiankeil
+ * Fix some cparser warnings.
+ *
* Revision 1.54 2008/09/20 10:04:33 fabiankeil
* Remove hide-forwarded-for-headers action which has
* been obsoleted by change-x-forwarded-for{block}.
*********************************************************************/
char * actions_to_text(const struct action_spec *action)
{
- unsigned mask = action->mask;
- unsigned add = action->add;
- char * result = strdup("");
+ unsigned long mask = action->mask;
+ unsigned long add = action->add;
+ char *result = strdup("");
struct list_entry * lst;
/* sanity - prevents "-feature +feature" */
char * actions_to_html(const struct client_state *csp,
const struct action_spec *action)
{
- unsigned mask = action->mask;
- unsigned add = action->add;
- char * result = strdup("");
+ unsigned long mask = action->mask;
+ unsigned long add = action->add;
+ char *result = strdup("");
struct list_entry * lst;
/* sanity - prevents "-feature +feature" */
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.63 2008/12/04 18:15:38 fabiankeil Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.64 2009/03/01 18:43:09 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
*
* Revisions :
* $Log: cgiedit.c,v $
+ * Revision 1.64 2009/03/01 18:43:09 fabiankeil
+ * Fix cparser warnings.
+ *
* Revision 1.63 2008/12/04 18:15:38 fabiankeil
* Fix some cparser warnings.
*
static jb_err actions_to_radio(struct map * exports,
const struct action_spec *action)
{
- unsigned mask = action->mask;
- unsigned add = action->add;
+ unsigned long mask;
+ unsigned long add;
int mapped_param;
int checked;
char current_mode;
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.89 2008/10/11 11:31:14 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.90 2009/03/01 18:43:09 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
*
* Revisions :
* $Log: cgisimple.c,v $
+ * Revision 1.90 2009/03/01 18:43:09 fabiankeil
+ * Fix cparser warnings.
+ *
* Revision 1.89 2008/10/11 11:31:14 fabiankeil
* Add FEATURE_CONNECTION_KEEP_ALIVE to the list
* of conditional defines on the show-status page.
static jb_err load_file(const char *filename, char **buffer, size_t *length)
{
FILE *fp;
- int ret;
+ long ret;
jb_err err = JB_ERR_OK;
fp = fopen(filename, "rb");
-const char filters_rcs[] = "$Id: filters.c,v 1.111 2008/12/04 18:13:46 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.112 2009/03/01 18:28:23 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.112 2009/03/01 18:28:23 fabiankeil
+ * Help clang understand that we aren't dereferencing
+ * NULL pointers here.
+ *
* Revision 1.111 2008/12/04 18:13:46 fabiankeil
* Fix a cparser warning.
*
/* since this path points into a user's home space
* be sure to include this spec in the trustfile.
*/
- int path_len = path_end - path; /* save offset */
+ long path_len = path_end - path; /* save offset */
path = strdup(path); /* Copy string */
if (path != NULL)
{
if (NULL != (socks_proxy = strchr(fwd->gateway_host, ':')))
{
*socks_proxy++ = '\0';
- fwd->gateway_port = strtol(socks_proxy, NULL, 0);
+ fwd->gateway_port = (int)strtol(socks_proxy, NULL, 0);
}
if (fwd->gateway_port <= 0)
if (NULL != (http_parent = strchr(fwd->forward_host, ':')))
{
*http_parent++ = '\0';
- fwd->forward_port = strtol(http_parent, NULL, 0);
+ fwd->forward_port = (int)strtol(http_parent, NULL, 0);
}
if (fwd->forward_port <= 0)
-const char jcc_rcs[] = "$Id: jcc.c,v 1.229 2009/03/07 11:17:01 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.230 2009/03/07 13:09:17 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.230 2009/03/07 13:09:17 fabiankeil
+ * Change csp->expected_content and_csp->expected_content_length from
+ * size_t to unsigned long long to reduce the likelihood of integer
+ * overflows that would let us close the connection prematurely.
+ * Bug found while investigating #2669131, reported by cyberpatrol.
+ *
* Revision 1.229 2009/03/07 11:17:01 fabiankeil
* Fix compiler warning.
*
* Since we have to wait for more from the server before
* we can parse the headers we just continue here.
*/
- int header_offset = csp->iob->cur - header_start;
+ long header_offset = csp->iob->cur - header_start;
assert(csp->iob->cur >= header_start);
byte_count += (unsigned long long)(len - header_offset);
log_error(LOG_LEVEL_CONNECT, "Continuing buffering headers. "
* XXX: the header lenght should probably
* be calculated by get_server_headers().
*/
- int header_length = csp->iob->cur - header_start;
+ long header_length = csp->iob->cur - header_start;
assert(csp->iob->cur > header_start);
byte_count += (unsigned long long)(len - header_length);
}