aboutsummaryrefslogtreecommitdiffstats
path: root/src/ragel
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-11-04 16:03:34 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-11-04 16:03:34 +0000
commit3548785ebdc0e9a9aefc782c85bccb08456e8f3f (patch)
tree7577414613aa45d28c7444eb5ef9ca39ee9b47c1 /src/ragel
parent80cb50dea482246656a49e54a915bdc343ffe897 (diff)
downloadrspamd-3548785ebdc0e9a9aefc782c85bccb08456e8f3f.tar.gz
rspamd-3548785ebdc0e9a9aefc782c85bccb08456e8f3f.zip
[Fix] Another story about char sign
Ragel still produces a wrong state machine if `const char *` is used for characters representation that are actually utf8. This PR changes all types to `unsigned char *` for consistency.
Diffstat (limited to 'src/ragel')
-rw-r--r--src/ragel/smtp_addr_parser.rl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ragel/smtp_addr_parser.rl b/src/ragel/smtp_addr_parser.rl
index b5b4863d3..330f3f01d 100644
--- a/src/ragel/smtp_addr_parser.rl
+++ b/src/ragel/smtp_addr_parser.rl
@@ -8,33 +8,33 @@
action IP4_end {}
action User_start {
- addr->user = p;
+ addr->user = (const char *)p;
}
action User_end {
if (addr->user) {
- addr->user_len = p - addr->user;
+ addr->user_len = (const char *)p - addr->user;
}
}
action Domain_start {
- addr->domain = p;
+ addr->domain = (const char *)p;
}
action Domain_end {
if (addr->domain) {
- addr->domain_len = p - addr->domain;
+ addr->domain_len = (const char *)p - addr->domain;
}
}
action Domain_addr_start {
- addr->domain = p;
+ addr->domain = (const char *)p;
addr->flags |= RSPAMD_EMAIL_ADDR_IP;
}
action Domain_addr_end {
if (addr->domain) {
- addr->domain_len = p - addr->domain;
+ addr->domain_len = (const char *)p - addr->domain;
}
}
@@ -64,12 +64,12 @@
}
action Addr_start {
- addr->addr = p;
+ addr->addr = (const char *)p;
}
action Addr_end {
if (addr->addr) {
- addr->addr_len = p - addr->addr;
+ addr->addr_len = (const char *)p - addr->addr;
}
}
@@ -87,7 +87,7 @@
int
rspamd_smtp_addr_parse (const char *data, size_t len, struct rspamd_email_address *addr)
{
- const char *p = data, *pe = data + len, *eof;
+ const unsigned char *p = (const unsigned char *)data, *pe = (const unsigned char *)data + len, *eof;
int cs;
g_assert (addr != NULL);