From 943873564c3ecbde18e52505bf12f3d7961192cd Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 16 Jun 2017 08:37:10 +0200 Subject: [PATCH] Fix empty buffer parser --- src/CmdParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CmdParser.cpp b/src/CmdParser.cpp index a4e723e..c8eeec7 100644 --- a/src/CmdParser.cpp +++ b/src/CmdParser.cpp @@ -24,7 +24,7 @@ uint16_t CmdParser::parseCmd(uint8_t *buffer, size_t bufferSize) m_paramCount = 0; // buffer is not okay - if (buffer == NULL || bufferSize == 0) { + if (buffer == NULL || bufferSize == 0 || buffer[0] == 0x00) { return CMDPARSER_ERROR; }