patch 9.1.0913: no error check for neg values for 'messagesopt'
Problem: no error check for neg values for 'messagesopt'
(after v9.1.0908)
Solution: add additional error checks and tests (h-east)
closes: #16187
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/message.c b/src/message.c
index f0d1806..0fb0013 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1133,12 +1133,10 @@
if (!(messages_flags_new & MESSAGES_HISTORY))
return FAIL;
- // "history" must be <= 10000
- if (messages_history_new > 10000)
+ if (messages_history_new < 0 || messages_history_new > 10000)
return FAIL;
- // "wait" must be <= 10000
- if (messages_wait_new > 10000)
+ if (messages_wait_new < 0 || messages_wait_new > 10000)
return FAIL;
msg_flags = messages_flags_new;