diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp index 1353c300192..a78e89a062b 100644 --- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp +++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp @@ -186,8 +186,8 @@ nsapi_error_t GEMALTO_CINTERION_CellularStack::socket_open_defer(CellularSocket } } if (strcmp(paramTag, "conId") == 0) { - char buf[10]; - std::sprintf(buf, "%d", _cid); + char buf[12]; + std::snprintf(buf, sizeof(buf), "%d", _cid); if (strcmp(paramValue, buf) == 0) { foundConIdType = true; }