From d8b8d5d5e0cbebbbb4b9ab1b66eb6fe33a1ad5ff Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Fri, 14 Jun 2019 16:41:18 -0700 Subject: [PATCH] fix dumb typo bug in signal/state input validation The effect was that it'd allow any state for signal 0, when it should have allowed state 0 for any signal. --- db/signal.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/signal.rs b/db/signal.rs index 7115865..0b8c5cf 100644 --- a/db/signal.rs +++ b/db/signal.rs @@ -290,7 +290,7 @@ impl State { let states = self.types_by_uuid.get(&s.type_) .map(|t| &t.states) .unwrap_or(&empty); - if signal != 0 && states.binary_search_by_key(&state, |s| s.value).is_err() { + if state != 0 && states.binary_search_by_key(&state, |s| s.value).is_err() { bail_t!(FailedPrecondition, "signal {} specifies unknown state {}", signal, state); }