Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register


Bug in ant.cpp


Total Posts: 523

Joined 2012-11-15


I think I found a bug in the ANT dll. In the ant.cpp file, in the MessageThread(void *pvParameter_) function, there is an if statement that determines whether or not SerialHaveMessage() will execute:

if (usSize != 0 && usSize != DSI_FRAMER_ERROR)
SerialHaveMessage(stMessage, usSize);

In the current code, usSize is checked against 0 and DSI_FRAMER_ERROR, which is 65535. We've found, though, that usSize can also have a value of DSI_FRAMER_TIMEDOUT, or 65534. If this case is not also handled and discarded, then the subsequent SerialHaveMessage() function will do a memcpy of 65534 bytes, which causes a crash on our systems every time.

I updated and recompiled the dll with this new if statement and everything seemed to function normally now:

if (usSize != 0 && usSize != DSI_FRAMER_TIMEDOUT && usSize != DSI_FRAMER_ERROR)


Total Posts: 662

Joined 2012-10-09


Thanks for pointing this out, this is very valuable feedback. We will incorporate the fix on the next version of the DLL we release.