- 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:
22
conman.c
22
conman.c
@ -1421,7 +1421,7 @@ int ConfigCon(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
|
||||
/* check no of args */
|
||||
if (argc < 2) {
|
||||
sprintf(pBueffel, "Insufficient number of args to %s", argv[0]);
|
||||
snprintf(pBueffel,511, "Insufficient number of args to %s", argv[0]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@ -1435,7 +1435,7 @@ int ConfigCon(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
return 1;
|
||||
} else if (strcmp(argv[1], "myname") == 0) {
|
||||
sprintf(pBueffel, "MyName = %s", ConName(pCon->ident));
|
||||
snprintf(pBueffel,511, "MyName = %s", ConName(pCon->ident));
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
return 1;
|
||||
} else if (strcmp(argv[1], "myrights") == 0) {
|
||||
@ -1464,7 +1464,7 @@ int ConfigCon(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
|
||||
/* check no or args */
|
||||
if (argc < 3) {
|
||||
sprintf(pBueffel, "Insufficient number of args to %s", argv[0]);
|
||||
snprintf(pBueffel,511, "Insufficient number of args to %s", argv[0]);
|
||||
SCWrite(pCon, pBueffel, eInError);
|
||||
return 0;
|
||||
}
|
||||
@ -1479,7 +1479,7 @@ int ConfigCon(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
i++;
|
||||
}
|
||||
if (i > iNoCodes) {
|
||||
sprintf(pBueffel, "OutCode %s not recognized", argv[2]);
|
||||
snprintf(pBueffel,511, "OutCode %s not recognized", argv[2]);
|
||||
SCWrite(pCon, pBueffel, eInError);
|
||||
return 0;
|
||||
}
|
||||
@ -1506,13 +1506,13 @@ int ConfigCon(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
return 1;
|
||||
} else if (strcmp(argv[1], "rights") == 0) {
|
||||
if (argc < 4) {
|
||||
sprintf(pBueffel, "Insufficient number of args to %s", argv[0]);
|
||||
snprintf(pBueffel,511, "Insufficient number of args to %s", argv[0]);
|
||||
SCWrite(pCon, pBueffel, eInError);
|
||||
return 0;
|
||||
}
|
||||
i = IsValidUser(argv[2], argv[3]);
|
||||
if (i < 0) {
|
||||
sprintf(pBueffel,
|
||||
snprintf(pBueffel,511,
|
||||
" %s with password ****** is NO valid User on SICS",
|
||||
argv[2]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
@ -1527,7 +1527,7 @@ int ConfigCon(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
WriteToCommandLogId("SYS>", pCon->sockHandle, pBueffel);
|
||||
}
|
||||
} else {
|
||||
sprintf(pBueffel, "User %s handle %d switched to %d privilege",
|
||||
snprintf(pBueffel, 511, "User %s handle %d switched to %d privilege",
|
||||
argv[2], pCon->sockHandle, i);
|
||||
WriteToCommandLog("SYS>", pBueffel);
|
||||
}
|
||||
@ -1722,7 +1722,7 @@ int ConSicsAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
/* get object */
|
||||
pCom = FindCommand(pSics, argv[2]);
|
||||
if (!pCom) {
|
||||
sprintf(pBueffel, "ERROR: object %s NOT found", argv[2]);
|
||||
snprintf(pBueffel,1024, "ERROR: object %s NOT found", argv[2]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@ -1733,7 +1733,7 @@ int ConSicsAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
pInterface = (pICallBack) pDum->pDescriptor->GetInterface(pDum,
|
||||
CALLBACKINTERFACE);
|
||||
if (!pInterface) {
|
||||
sprintf(pBueffel, "ERROR: %s does not support CallBacks", argv[2]);
|
||||
snprintf(pBueffel,1023, "ERROR: %s does not support CallBacks", argv[2]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@ -1741,7 +1741,7 @@ int ConSicsAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
/* get Event */
|
||||
iEvent = Text2Event(argv[3]);
|
||||
if (iEvent < 0) {
|
||||
sprintf(pBueffel, "ERROR: Unknown event code %s", argv[3]);
|
||||
snprintf(pBueffel,1023, "ERROR: Unknown event code %s", argv[3]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@ -1855,7 +1855,7 @@ int SCTaskFunction(void *pData)
|
||||
}
|
||||
} else {
|
||||
ANETinfo(self->sockHandle, pHost, 131);
|
||||
sprintf(pBueffel,
|
||||
snprintf(pBueffel, 511,
|
||||
"Accepted connection %s on socket %d from %s",
|
||||
ConName(self->ident), self->sockHandle, pHost);
|
||||
SICSLogWrite(pBueffel, eInternal);
|
||||
|
Reference in New Issue
Block a user