diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-22 11:16:19 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-22 11:16:19 +0200 |
commit | f62aeba4207beaeeff63af970ec5d6bb2fb1e8a7 (patch) | |
tree | 5ab79591d24d1d2e1565a0c989a5b99217e908ed /src/modules/systemlib/mixer/mixer.cpp | |
parent | 669d4c6dd26cec44196f755b223da588439816c6 (diff) | |
download | px4-firmware-f62aeba4207beaeeff63af970ec5d6bb2fb1e8a7.tar.gz px4-firmware-f62aeba4207beaeeff63af970ec5d6bb2fb1e8a7.tar.bz2 px4-firmware-f62aeba4207beaeeff63af970ec5d6bb2fb1e8a7.zip |
Cover last potential corner case with mixers, should be totally safe now
Diffstat (limited to 'src/modules/systemlib/mixer/mixer.cpp')
-rw-r--r-- | src/modules/systemlib/mixer/mixer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/systemlib/mixer/mixer.cpp b/src/modules/systemlib/mixer/mixer.cpp index df0dfe838..7d9ddba8f 100644 --- a/src/modules/systemlib/mixer/mixer.cpp +++ b/src/modules/systemlib/mixer/mixer.cpp @@ -142,6 +142,12 @@ NullMixer * NullMixer::from_text(const char *buf, unsigned &buflen) { NullMixer *nm = nullptr; + const char *end = buf + buflen; + + /* require a space or newline at the end of the buffer */ + if (*end != ' ' && *end != '\n' && *end != '\r') { + return nm; + } if ((buflen >= 2) && (buf[0] == 'Z') && (buf[1] == ':')) { nm = new NullMixer; |