#include "upstream.h"
#include "ref.h"
-static const unsigned base = 36;
-static const unsigned t_min = 1;
-static const unsigned t_max = 26;
-static const unsigned skew = 38;
-static const unsigned damp = 700;
-static const unsigned initial_n = 128;
-static const unsigned initial_bias = 72;
-
static const int dns_port = 53;
static const int default_io_cnt = 8;
*/
#include "dns_private.h"
-
+static const unsigned base = 36;
+static const unsigned t_min = 1;
+static const unsigned t_max = 26;
+static const unsigned skew = 38;
+static const unsigned damp = 700;
+static const unsigned initial_n = 128;
+static const unsigned initial_bias = 72;
/* Punycode utility */
static unsigned int
digit (unsigned n)
EVP_CIPHER_CTX *s = enc_ctx;
gint r;
- r = outlen ? *outlen : inlen;
+ r = inlen;
g_assert (EVP_EncryptUpdate (s, out, &r, in, inlen) == 1);
if (outlen) {
if (elt && elt->append_crlf) {
rspamd_dkim_signature_update (ctx, elt->begin, elt->len + 1);
}
- else {
+ else if (elt) {
rspamd_dkim_signature_update (ctx, elt->begin, elt->len);
}
}
struct rspamd_expression_elt *ea = a->data, *eb = b->data;
gdouble w1, w2;
+
/* Special logic for atoms */
if (ea->type == ELT_ATOM && eb->type == ELT_ATOM &&
ea->priority == eb->priority) {
static gboolean
rspamd_ast_resort_traverse (GNode *node, gpointer unused)
{
+ GNode *children, *last;
+
if (node->children) {
+
+ children = node->children;
+ last = g_node_last_sibling (children);
+ /* Needed for utlist compatibility */
+ children->prev = last;
DL_SORT (node->children, rspamd_ast_priority_cmp);
+ /* Restore GLIB compatibility */
+ children = node->children;
+ children->prev = NULL;
}
return FALSE;
{
static const char b32[]="ybndrfg8ejkmcpqxot1uwisza345h769";
gchar *o, *end;
- gsize i, r;
+ gsize i;
gint remain = -1, x;
end = out + outlen;
o = out;
- for (i = 0, r = 0; i < inlen && o < end - 1; i++) {
+ for (i = 0; i < inlen && o < end - 1; i++) {
switch (i % 5) {
case 0:
/* 8 bits of input and 3 to remain */
}
}
- if (use_cur) {
+ if (use_cur && selected) {
if (selected->cur_weight > 0) {
selected->cur_weight--;
}
selected->cur_weight = selected->weight;
}
}
+
rspamd_mutex_unlock (ups->lock);
return selected;
s += rcptlen;
continue;
}
- else if (*c == '%' && *(c + 1) == 'r') {
- c += 2;
- memcpy (s, from, fromlen);
- s += fromlen;
- continue;
- }
*s++ = *c;
}
{
struct cdb *cdb = lua_check_cdb (L);
+ if (!cdb) {
+ lua_error (L);
+ return 1;
+ }
lua_pushstring (L, cdb->filename);
return 1;
}
gsize vlen;
gint64 vpos;
+ if (!cdb) {
+ lua_error (L);
+ return 1;
+ }
/*
* XXX: this code is placed here because event_loop is called inside workers, so start
* monitoring on first check, not on creation
gint ret;
guint i, nret = 0;
+ if (ctx == NULL) {
+ lua_error (L);
+
+ return 1;
+ }
+
if (ctx->async) {
lua_pushstring (L, "Async redis pipelining is not implemented");
lua_error (L);