BasicFileServer::handleRead() error handling fix

This commit is contained in:
Pavel Kirienko
2015-05-20 22:13:32 +03:00
parent 5358c734ef
commit 489a27f70d
@@ -136,6 +136,11 @@ class BasicFileServer
resp.error.value = backend_.read(req.path.path, req.offset, resp.data.begin(), inout_size);
if (resp.error.value != protocol::file::Error::OK)
{
inout_size = 0;
}
if (inout_size > resp.data.capacity())
{
UAVCAN_ASSERT(0);