Unverified Commit 238bfc88 authored by Shawn Webb's avatar Shawn Webb
Browse files

Perform sanity checks when setting the Pushover message priority



Ensuring sane values for any user-defined input is always a good idea.
Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
parent 9e7dd793
......@@ -196,8 +196,19 @@ pushover_message_set_priority(pushover_message_t *msg,
{
assert(msg != NULL);
/* XXX more sanity checking */
msg->psh_priority = prio;
switch (prio) {
case PSH_PRIO_NONE:
case PSH_PRIO_QUIET:
case PSH_PRIO_DEF:
case PSH_PRIO_HIGH:
case PSH_PRIO_CONFIRM:
msg->psh_priority = prio;
break;
default:
return (false);
}
return (true);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment