rashaabdulrazzak / arbotix

Automatically exported from code.google.com/p/arbotix
0 stars 0 forks source link

Unchecked buffer #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In ax12.cpp your implementation of ISR(USART1_RX_vect) can cause the 
ax_rx_int_buffer to overflow (and the Arduino to crash) when a servo starts 
sending error packets.

I've added a buffer check to prevent this:

ISR(USART1_RX_vect){
++  if (ax_rx_int_Pointer < AX12_BUFFER_SIZE)
        ax_rx_int_buffer[(ax_rx_int_Pointer++)] = UDR1;
}

Original issue reported on code.google.com by m.a.admi...@gmail.com on 28 Sep 2013 at 10:29

Attachments: