Skip to content

Commit 0ea5dec

Browse files
authored
Merge pull request #15404 from IVOES/fix-overrunning-write
Fix potentially overrunning write of sprintf
2 parents 9a82ad6 + c958d1d commit 0ea5dec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ nsapi_error_t GEMALTO_CINTERION_CellularStack::socket_open_defer(CellularSocket
186186
}
187187
}
188188
if (strcmp(paramTag, "conId") == 0) {
189-
char buf[10];
190-
std::sprintf(buf, "%d", _cid);
189+
char buf[12];
190+
std::snprintf(buf, sizeof(buf), "%d", _cid);
191191
if (strcmp(paramValue, buf) == 0) {
192192
foundConIdType = true;
193193
}

0 commit comments

Comments
 (0)