ronnier91 / i2c-gps-nav

Automatically exported from code.google.com/p/i2c-gps-nav
0 stars 0 forks source link

arraysize of string is too small #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. if (offset < 15)
                    string[offset++] = c;

the next character received is a '*', or ',' then there is a write outside the 
array boundaries:

case ',':
case '*':
          string[offset] = 0;

Version 22 used.

Either change the array size or if (offset < 15) to if (offset < 14)

Original issue reported on code.google.com by olf...@gmail.com on 18 Jan 2015 at 2:07