rspamd_http_router_insert_headers (entry->rt, reply_msg);
if (!rspamd_http_message_set_body_from_fd (reply_msg, fd)) {
+ rspamd_http_message_free (reply_msg);
close (fd);
return FALSE;
}
const struct rspamd_logger_funcs *funcs = NULL;
- switch (cfg->log_type) {
- case RSPAMD_LOG_CONSOLE:
+ if (cfg) {
+ switch (cfg->log_type) {
+ case RSPAMD_LOG_CONSOLE:
+ funcs = &console_log_funcs;
+ break;
+ case RSPAMD_LOG_SYSLOG:
+ funcs = &syslog_log_funcs;
+ break;
+ case RSPAMD_LOG_FILE:
+ funcs = &file_log_funcs;
+ break;
+ }
+ }
+ else {
funcs = &console_log_funcs;
- break;
- case RSPAMD_LOG_SYSLOG:
- funcs = &syslog_log_funcs;
- break;
- case RSPAMD_LOG_FILE:
- funcs = &file_log_funcs;
- break;
}
g_assert (funcs != NULL);
case st_len_1:
/* The first length byte in big endian order */
priv->parser.datalen = 0;
- priv->parser.datalen |= *p << 24;
+ priv->parser.datalen |= ((gsize)*p) << 24;
priv->parser.state = st_len_2;
p++;
break;
case st_len_2:
/* The second length byte in big endian order */
- priv->parser.datalen |= *p << 16;
+ priv->parser.datalen |= ((gsize)*p) << 16;
priv->parser.state = st_len_3;
p++;
break;
case st_len_3:
/* The third length byte in big endian order */
- priv->parser.datalen |= *p << 8;
+ priv->parser.datalen |= ((gsize)*p) << 8;
priv->parser.state = st_len_4;
p++;
break;
case st_len_4:
/* The fourth length byte in big endian order */
- priv->parser.datalen |= *p;
+ priv->parser.datalen |= ((gsize)*p);
priv->parser.state = st_read_cmd;
p++;
break;