aboutsummaryrefslogtreecommitdiff
path: root/apps/systemlib
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-10-29 18:00:32 -0700
committerpx4dev <px4@purgatory.org>2012-10-29 21:47:51 -0700
commit7203ba797e40b146e7b85b83a6f691e260245a58 (patch)
tree150968a88cb5c13e0ab741289769f9544a294118 /apps/systemlib
parent3420e7b828894bff502cbf9f70fac5ce262542b2 (diff)
downloadpx4-firmware-7203ba797e40b146e7b85b83a6f691e260245a58.tar.gz
px4-firmware-7203ba797e40b146e7b85b83a6f691e260245a58.tar.bz2
px4-firmware-7203ba797e40b146e7b85b83a6f691e260245a58.zip
bson-based boardinfo working
Diffstat (limited to 'apps/systemlib')
-rw-r--r--apps/systemlib/bson/tinybson.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/systemlib/bson/tinybson.c b/apps/systemlib/bson/tinybson.c
index e1a9324a2..1b5a1e1ee 100644
--- a/apps/systemlib/bson/tinybson.c
+++ b/apps/systemlib/bson/tinybson.c
@@ -144,7 +144,7 @@ bson_decoder_init_buf(bson_decoder_t decoder, void *buf, unsigned bufsize, bson_
/* read and discard document size */
if (read_int32(decoder, &len))
CODER_KILL(decoder, "failed reading length");
- if (len > (int)bufsize)
+ if ((len > 0) && (len > (int)bufsize))
CODER_KILL(decoder, "document length larger than buffer");
/* ready for decoding */