aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-20 15:55:39 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-20 15:55:39 +0000
commitf71dee6d40be52c69f5a90536e811db8e1f852f1 (patch)
treeb6f02f94241528d29ec628a0ac2c66f5e32c68aa /src/libutil/str_util.c
parentf5bebd97dba16d9994d49b5b8832b72950d511cd (diff)
downloadrspamd-f71dee6d40be52c69f5a90536e811db8e1f852f1.tar.gz
rspamd-f71dee6d40be52c69f5a90536e811db8e1f852f1.zip
[Fix] Fix quoted-printable soft newlines bugged case
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 1e7d0b06b..2e1fd6a0d 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -2341,15 +2341,19 @@ decode:
if (c >= '0' && c <= '9') { ret = c - '0'; }
else if (c >= 'A' && c <= 'F') { ret = c - 'A' + 10; }
else if (c >= 'a' && c <= 'f') { ret = c - 'a' + 10; }
- else if (c == '\r' || c == '\n') {
- /* Soft line break */
- while (remain > 0 && (*p == '\r' || *p == '\n')) {
- remain --;
+ else if (c == '\r') {
+ /* Eat one more endline */
+ if (remain > 0 && *p == '\n') {
p ++;
+ remain --;
}
continue;
}
+ else if (c == '\n') {
+ /* Soft line break */
+ continue;
+ }
else {
/* Hack, hack, hack, treat =<garbadge> as =<garbadge> */
if (remain > 0) {