Can easily overflow the 40 byte size if the APN, username or password parameters are non trivial (10 character length each, for example).
Leads to overwriting stack memory and possible unexpected errors (in my case, overwriting the operator_type variable memory position). The main problem is it's silent nature, without errors.
Possible fix could be increasing this buffer, although some sort of size check, preferably using snprintf_P and checking the string length of the returned values
Currently the WaspBG96::gprsConnection function has a buffer for the commands sent to the BG96 module of 40 bytes:
But the AT command:
Can easily overflow the 40 byte size if the
APN
,username
orpassword
parameters are non trivial (10 character length each, for example). Leads to overwriting stack memory and possible unexpected errors (in my case, overwriting theoperator_type
variable memory position). The main problem is it's silent nature, without errors. Possible fix could be increasing this buffer, although some sort of size check, preferably usingsnprintf_P
and checking the string length of the returned values