summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-09-05 07:24:15 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-09-05 07:24:15 (GMT)
commitdcba6221872d3f43b436a7cac301142f63d0286f (patch) (side-by-side diff)
tree8635ada1363e101cf7a2f0e9ed4ee348c057f5f5
parentcd3a5a6d98e23e20e5fad3b5da108c4a11a9032d (diff)
downloadmailutils-dcba6221872d3f43b436a7cac301142f63d0286f.tar.gz
mailutils-dcba6221872d3f43b436a7cac301142f63d0286f.tar.bz2
Fix parsing of IMAP ranges with the lower value less than the actual message set minimum
* libmailutils/msgset/parse.c (get_msgnum): Make sure the returned is in the [minval,maxval] interval.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libmailutils/msgset/parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmailutils/msgset/parse.c b/libmailutils/msgset/parse.c
index 2d0362e..a249d3d 100644
--- a/libmailutils/msgset/parse.c
+++ b/libmailutils/msgset/parse.c
@@ -55,7 +55,9 @@ get_msgnum (struct parse_msgnum_env *env, size_t *pn)
if (msgnum == ULONG_MAX && errno == ERANGE)
return MU_ERR_PARSE;
env->s = p;
- if (env->msgset->mbox && env->maxval && msgnum > env->maxval)
+ if (env->minval && msgnum < env->minval)
+ msgnum = env->minval;
+ if (env->maxval && msgnum > env->maxval)
msgnum = env->maxval;
*pn = msgnum;
return 0;

Return to:

Send suggestions and report system problems to the System administrator.