@@ -484,7 +484,7 @@ SARA_R5_error_t SARA_R5::enableEcho(boolean enable)
484
484
String SARA_R5::imei (void )
485
485
{
486
486
char *response;
487
- char imeiResponse[16 ];
487
+ char imeiResponse[16 ] = { 0x00 } ;
488
488
SARA_R5_error_t err;
489
489
490
490
response = sara_r5_calloc_char (sizeof (imeiResponse) + 16 );
@@ -506,7 +506,7 @@ String SARA_R5::imei(void)
506
506
String SARA_R5::imsi (void )
507
507
{
508
508
char *response;
509
- char imsiResponse[16 ];
509
+ char imsiResponse[16 ] = { 0x00 } ;
510
510
SARA_R5_error_t err;
511
511
512
512
response = sara_r5_calloc_char (sizeof (imsiResponse) + 16 );
@@ -527,7 +527,7 @@ String SARA_R5::imsi(void)
527
527
String SARA_R5::ccid (void )
528
528
{
529
529
char *response;
530
- char ccidResponse[21 ];
530
+ char ccidResponse[21 ] = { 0x00 } ;
531
531
SARA_R5_error_t err;
532
532
533
533
response = sara_r5_calloc_char (sizeof (ccidResponse) + 16 );
@@ -662,6 +662,7 @@ SARA_R5_error_t SARA_R5::clock(uint8_t *y, uint8_t *mo, uint8_t *d,
662
662
*s = is;
663
663
*tz = itz;
664
664
}
665
+ else err = SARA_R5_ERROR_UNEXPECTED_RESPONSE;
665
666
}
666
667
667
668
free (command);
@@ -837,6 +838,10 @@ SARA_R5_error_t SARA_R5::setAPN(String apn, uint8_t cid, SARA_R5_pdp_type pdpTyp
837
838
case PDP_TYPE_IPV6:
838
839
memcpy (pdpStr, " IPV6" , 2 );
839
840
break ;
841
+ default :
842
+ free (command);
843
+ return LTE_SHIELD_ERROR_UNEXPECTED_PARAM;
844
+ break ;
840
845
}
841
846
sprintf (command, " %s=%d,\" %s\" ,\" %s\" " , SARA_R5_MESSAGE_PDP_DEF,
842
847
cid, pdpStr, apn.c_str ());
0 commit comments