- After a bug at TRICS I replaced all occurrences of strcpy, strcat, sprintf
by length limited versions wherever appropriate. SKIPPED: psi/el755driv.c psi/faverage.c psi/frame.c psi/lmd200.c psi/polterwrite.c psi/psi.c psi/sanswave.c psi/sinqhmdriv.c psi/termprot.c
This commit is contained in:
10
protocol.c
10
protocol.c
@ -236,7 +236,7 @@ static int ProtocolOptions(SConnection * pCon, pProtocol pPro)
|
||||
int i;
|
||||
char pBuffer[80];
|
||||
for (i = 0; i < pPro->iNumPros; i++) {
|
||||
sprintf(pBuffer, "Protocol[%d] = %s", i, pPro->pProList[i]);
|
||||
snprintf(pBuffer,sizeof(pBuffer)-1, "Protocol[%d] = %s", i, pPro->pProList[i]);
|
||||
SCWrite(pCon, pBuffer, eValue);
|
||||
}
|
||||
return 1;
|
||||
@ -498,7 +498,7 @@ int SCWriteSycamore(SConnection * pCon, char *pBuffer, int iOut)
|
||||
} else {
|
||||
iRet = 0;
|
||||
}
|
||||
sprintf(pBueffel, "Next line intended for socket: %d", iRet);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "Next line intended for socket: %d", iRet);
|
||||
SICSLogWrite(pBueffel, eInternal);
|
||||
SICSLogWrite(pBuffer, iOut);
|
||||
|
||||
@ -529,9 +529,9 @@ int SCWriteSycamore(SConnection * pCon, char *pBuffer, int iOut)
|
||||
pMsgString = CreateDynString(INIT_STR_SIZE, STR_RESIZE_LENGTH);
|
||||
pBueffel[0] = '\0';
|
||||
|
||||
sprintf(pBueffel, "[con%4.4d:", (int) pCon->ident); /* field 1: connID */
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "[con%4.4d:", (int) pCon->ident); /* field 1: connID */
|
||||
DynStringConcat(pMsg, pBueffel);
|
||||
sprintf(pBueffel, "t%6.6d:", (int) taskID); /* field 2: taskID */
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "t%6.6d:", (int) taskID); /* field 2: taskID */
|
||||
DynStringConcat(pMsg, pBueffel);
|
||||
/* deviceID */
|
||||
DynStringConcat(pMsg, comCon.deviceID);
|
||||
@ -698,7 +698,7 @@ int SCWriteJSON_String(SConnection * pCon, char *pBuffer, int iOut)
|
||||
} else {
|
||||
iRet = 0;
|
||||
}
|
||||
sprintf(pBueffel, "Next line intended for socket: %d", iRet);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "Next line intended for socket: %d", iRet);
|
||||
SICSLogWrite(pBueffel, eInternal);
|
||||
SICSLogWrite(pBuffer, iOut);
|
||||
|
||||
|
Reference in New Issue
Block a user