Skip to content

Commit d2d822e

Browse files
committed
Correct the pdpStr memcpy lengths in setAPN
1 parent 3a2254d commit d2d822e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SparkFun_u-blox_SARA-R5_Arduino_Library.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,13 +1261,13 @@ SARA_R5_error_t SARA_R5::setAPN(String apn, uint8_t cid, SARA_R5_pdp_type pdpTyp
12611261
memcpy(pdpStr, "IP", 2);
12621262
break;
12631263
case PDP_TYPE_NONIP:
1264-
memcpy(pdpStr, "NONIP", 2);
1264+
memcpy(pdpStr, "NONIP", 5);
12651265
break;
12661266
case PDP_TYPE_IPV4V6:
1267-
memcpy(pdpStr, "IPV4V6", 2);
1267+
memcpy(pdpStr, "IPV4V6", 6);
12681268
break;
12691269
case PDP_TYPE_IPV6:
1270-
memcpy(pdpStr, "IPV6", 2);
1270+
memcpy(pdpStr, "IPV6", 4);
12711271
break;
12721272
default:
12731273
free(command);

0 commit comments

Comments
 (0)