- 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:
@@ -98,7 +98,7 @@ int BackupStatus(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
motorSave = 0;
|
||||
else
|
||||
motorSave = 1;
|
||||
sprintf(pBueffel, "New Value of motorSave= %d\n", motorSave);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "New Value of motorSave= %d\n", motorSave);
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
return 1;
|
||||
} else {
|
||||
@@ -107,7 +107,7 @@ int BackupStatus(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
}
|
||||
|
||||
if (!iRet) {
|
||||
sprintf(pBueffel, "ERROR: could not open file %s\n", argv[1]);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "ERROR: could not open file %s\n", argv[1]);
|
||||
SCWrite(pCon, pBueffel, eError);
|
||||
return 0;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ int RestoreStatus(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
if (argc < 2) {
|
||||
pFile = IFindOption(pSICSOptions, "statusfile");
|
||||
if (pFile) {
|
||||
sprintf(pBueffel, "%s", pFile);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%s", pFile);
|
||||
} else {
|
||||
SCWrite(pCon, "ERROR: No filename given for backup, Aborted.",
|
||||
eError);
|
||||
@@ -250,7 +250,7 @@ int RestoreStatus(SConnection * pCon, SicsInterp * pSics, void *pData,
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
sprintf(pBueffel, "%s", argv[1]);
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "%s", argv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user