@@ -39,7 +39,7 @@ UBX_CELL_error_t SARA_R5::getUtimeMode(UBX_CELL_utime_mode_t *mode, UBX_CELL_uti
39
39
if (err == UBX_CELL_ERROR_SUCCESS)
40
40
{
41
41
int mStore , sStore , scanned = 0 ;
42
- char *searchPtr = strstr (response, " +UTIME:" );
42
+ char *searchPtr = strnstr (response, " +UTIME:" , minimumResponseAllocation );
43
43
if (searchPtr != nullptr )
44
44
{
45
45
searchPtr += strlen (" +UTIME:" ); // Move searchPtr to first character - probably a space
@@ -95,7 +95,7 @@ UBX_CELL_error_t SARA_R5::getUtimeIndication(UBX_CELL_utime_urc_configuration_t
95
95
if (err == UBX_CELL_ERROR_SUCCESS)
96
96
{
97
97
int cStore, scanned = 0 ;
98
- char *searchPtr = strstr (response, " +UTIMEIND:" );
98
+ char *searchPtr = strnstr (response, " +UTIMEIND:" , minimumResponseAllocation );
99
99
if (searchPtr != nullptr )
100
100
{
101
101
searchPtr += strlen (" +UTIMEIND:" ); // Move searchPtr to first char
@@ -149,7 +149,7 @@ UBX_CELL_error_t SARA_R5::getUtimeConfiguration(int32_t *offsetNanoseconds, int3
149
149
if (err == UBX_CELL_ERROR_SUCCESS)
150
150
{
151
151
int scanned = 0 ;
152
- char *searchPtr = strstr (response, " +UTIMECFG:" );
152
+ char *searchPtr = strnstr (response, " +UTIMECFG:" , minimumResponseAllocation );
153
153
if (searchPtr != nullptr )
154
154
{
155
155
searchPtr += strlen (" +UTIMECFG:" ); // Move searchPtr to first char
@@ -263,7 +263,7 @@ UBX_CELL_error_t SARA_R5::getNetworkAssignedIPAddress(int profile, IPAddress *ad
263
263
264
264
if (err == UBX_CELL_ERROR_SUCCESS)
265
265
{
266
- char *searchPtr = strstr (response, " +UPSND:" );
266
+ char *searchPtr = strnstr (response, " +UPSND:" , minimumResponseAllocation );
267
267
if (searchPtr != nullptr )
268
268
{
269
269
searchPtr += strlen (" +UPSND:" ); // Move searchPtr to first char
@@ -298,7 +298,7 @@ bool SARA_R5::urcHandlerPDPAction(const char *event)
298
298
int scanNum;
299
299
int remoteIPstore[4 ];
300
300
301
- char *searchPtr = strstr (event, UBX_CELL_MESSAGE_PDP_ACTION_URC);
301
+ char *searchPtr = strnstr (event, UBX_CELL_MESSAGE_PDP_ACTION_URC, _RXBuffSize );
302
302
if (searchPtr != nullptr )
303
303
{
304
304
searchPtr += strlen (UBX_CELL_MESSAGE_PDP_ACTION_URC); // Move searchPtr to first character - probably a space
0 commit comments