Skip to content
Snippets Groups Projects
Commit 19a4f098 authored by Daniel Agar's avatar Daniel Agar
Browse files

gyrosim fix transfer hardcoded buffer index

 - fixes coverity CID 196758
parent a48e3bf6
No related branches found
No related tags found
No related merge requests found
......@@ -506,8 +506,11 @@ GYROSIM::transfer(uint8_t *send, uint8_t *recv, unsigned len)
// FIXME - not sure what interrupt status should be
recv[1] = 0;
// skip cmd and status bytes
sim->getMPUReport(&recv[2], len - 2);
if (len > 2) {
sim->getMPUReport(&recv[2], len - 2);
}
} else if (cmd & DIR_READ) {
PX4_DEBUG("Reading %u bytes from register %u", len - 1, reg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment