| ??? 12/27/07 09:53 Read: times |
#148773 - Buffer overflow handling Responding to: ???'s previous message |
It is not a problem to add the overflow management to the interrupt code. However it is a PITA to handle the situation correctly after the overflow has occurred so that the main code receives correct bytes before the overflow and then receives an error code. One way is to have a word instead of a byte buffer.
Forgetting to handle overflow does not usually hurt the system by writing data to unwanted positions but it merely cooks a bitsoup out of the buffer data as the pointers go past each other. The resulting data may be in wrong order or totally vanished. Creating a buffer that can overwrite memory that does not belong to it is a clear recommendation to rewrite the code. |



