From 409468d773304302d6fff6e3d70bbb9ff734c5e9 Mon Sep 17 00:00:00 2001 From: tsaichristine Date: Mon, 28 Oct 2019 11:32:31 -0700 Subject: [PATCH] Return false if incorrect event value type - getDoubleOrLong sets the return value if the event value type is an int, long, float, or double. If none of these types are matched, the default switch case should return false. Test: bit statsd_test:* Change-Id: I55f0bd5865810627da4fc62440f9450c0b1fa730 --- cmds/statsd/src/metrics/ValueMetricProducer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds/statsd/src/metrics/ValueMetricProducer.cpp b/cmds/statsd/src/metrics/ValueMetricProducer.cpp index 6fd03273a4341..0ee156b07c558 100644 --- a/cmds/statsd/src/metrics/ValueMetricProducer.cpp +++ b/cmds/statsd/src/metrics/ValueMetricProducer.cpp @@ -650,6 +650,7 @@ bool getDoubleOrLong(const LogEvent& event, const Matcher& matcher, Value& ret) ret.setDouble(value.mValue.double_value); break; default: + return false; break; } return true;