a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); \
c = PLUS(c,d); b = ROTATE(XOR(b,c), 7);
-static const char sigma[16] = "expand 32-byte k";
+static const char sigma[] = "expand 32-byte k";
static void ECRYPT_keysetup(ECRYPT_ctx *x,const u8 *k,u32 ivbits)
{
if (nread <= 0) return 0;
if (c <= 0x7F || locale::is8BitEncoding) { // short circuit ASCII
utf8Count = 0;
- return c;
+ return static_cast<char32_t>(c);
} else if (utf8Count < sizeof(utf8String) - 1) {
utf8String[utf8Count++] = c;
utf8String[utf8Count] = 0;
if (sscanf(version_str, "%u.%u.%u", &major, &minor, &patch) == 3) {
// Format: (major << 24) | (minor << 16) | (patch << 8) | 0
cached_version = (major << 24) | (minor << 16) | (patch << 8);
- msg_debug_hyperscan("detected hyperscan runtime version: %s (0x%08x)",
+ msg_debug_hyperscan("detected hyperscan runtime version: %s (0x%08xd)",
version_str, cached_version);
}
else {
// Fallback to compile-time version if available
#ifdef HS_DB_VERSION
cached_version = HS_DB_VERSION;
- msg_debug_hyperscan("using compile-time hyperscan version: 0x%08x", cached_version);
+ msg_debug_hyperscan("using compile-time hyperscan version: 0x%08xd", cached_version);
#else
cached_version = 0;
#endif
rspamd_log_line_hex_escape(const unsigned char *src, gsize srclen,
char *dst, gsize dstlen)
{
- static const char hexdigests[16] = "0123456789ABCDEF";
+ static const char hexdigests[] = "0123456789ABCDEF";
char *d = dst;
static uint32_t escape[] = {
/* Parse metadata as UCL (detect JSON vs msgpack from Content-Type) */
struct ucl_parser *parser;
- gboolean is_msgpack = FALSE;
if (metadata_part->content_type &&
metadata_part->content_type_len > 0 &&
metadata_part->content_type_len,
"msgpack",
sizeof("msgpack") - 1) != -1) {
- is_msgpack = TRUE;
parser = ucl_parser_new(UCL_PARSER_SAFE_FLAGS);
ucl_parser_add_chunk_full(parser, (const unsigned char *) metadata_part->data,
metadata_part->data_len,
#endif
struct rspamd_ssl_connection;
+struct rspamd_external_libs_ctx;
typedef void (*rspamd_ssl_handler_t)(int fd, short what, gpointer d);
rspamd_mempool_t *pool)
{
unsigned char *dest, *d, *dend;
- static const char hexdigests[16] = "0123456789ABCDEF";
+ static const char hexdigests[] = "0123456789ABCDEF";
unsigned int i;
gsize dlen = 0;
v += c;
}
}
- else if (c >= 'a' || c <= 'f') {
+ else if (c >= 'a' && c <= 'f') {
c = c - 'a' + 10;
if (v > cutoff || (v == cutoff && (uint8_t) c > cutlim)) {
/* Range error */
char *out;
int ch, last_sp;
const unsigned char *end = in + inlen, *p = in;
- static const char hexdigests[16] = "0123456789ABCDEF";
+ static const char hexdigests[] = "0123456789ABCDEF";
while (p < end) {
ch = *p;
{
char *o, *end;
const unsigned char *p;
- static const char hexdigests[16] = "0123456789abcdef";
+ static const char hexdigests[] = "0123456789abcdef";
end = out + outlen;
o = out;
char *out, gsize outlen)
{
char *o = out, *end = out + outlen, c;
- static const char hexdigests[16] = "0123456789ABCDEF";
+ static const char hexdigests[] = "0123456789ABCDEF";
while (inlen > 0 && o < end) {
c = *in;
const char *p, *end = pattern + slen;
char *res, *d, t, *tmp_utf = NULL, *dend;
gsize len;
- static const char hexdigests[16] = "0123456789abcdef";
+ static const char hexdigests[] = "0123456789abcdef";
len = 0;
p = pattern;
void rspamd_random_hex(char *buf, uint64_t len)
{
- static const char hexdigests[16] = "0123456789abcdef";
+ static const char hexdigests[] = "0123456789abcdef";
int64_t i;
g_assert(len > 0);
char *outbuf, gsize len,
enum lua_logger_escape_type esc_type)
{
- static const char hexdigests[16] = "0123456789abcdef";
+ static const char hexdigests[] = "0123456789abcdef";
gsize slen;
const unsigned char *str = lua_tolstring(L, pos, &slen);
unsigned char c;
cbd = g_new0(struct lua_tcp_cbdata, 1);
if (task) {
- static const char hexdigests[16] = "0123456789abcdef";
+ static const char hexdigests[] = "0123456789abcdef";
cfg = task->cfg;
ev_base = task->event_loop;