- After a bug at TRICS I replaced all occurrences of strcpy, strcat, sprintf

by length limited versions wherever appropriate.
This commit is contained in:
koennecke
2009-12-04 12:58:45 +00:00
parent 09826fb097
commit 4127cbb166
9 changed files with 42 additions and 43 deletions

View File

@ -60,7 +60,7 @@ static void PrintHMError(char *text, SConnection * pCon)
char pBueffel[1064];
strcpy(pBueffel, "ERROR: Histogram Memory --> ");
strcat(pBueffel, text);
strncat(pBueffel, text,1024);
SCWrite(pCon, pBueffel, eError);
}
@ -160,7 +160,7 @@ static int SQConfigure(pHistDriver self, SConnection * pCon,
strtolower(pValue);
iRet = Text2Mode(pValue);
if (iRet < 0) {
sprintf(pBueffel, "ERROR: Invalid parameter %s to HistMode", pValue);
snprintf(pBueffel,255, "ERROR: Invalid parameter %s to HistMode", pValue);
SCWrite(pCon, pBueffel, eError);
return 0;
}
@ -175,7 +175,7 @@ static int SQConfigure(pHistDriver self, SConnection * pCon,
strtolower(pValue);
iRet = Text2Flow(pValue);
if (iRet < 0) {
sprintf(pBueffel, "ERROR: Invalid parameter %s to OverflowMode",
snprintf(pBueffel,255, "ERROR: Invalid parameter %s to OverflowMode",
pValue);
SCWrite(pCon, pBueffel, eError);
return 0;
@ -187,7 +187,7 @@ static int SQConfigure(pHistDriver self, SConnection * pCon,
if (!iRet) {
iRet = StringDictGet(pOpt, "binwidth", pValue, 79);
if (iRet) {
sprintf(pBueffel, "ERROR: %s not valid for BinWidth ", pValue);
snprintf(pBueffel,255, "ERROR: %s not valid for BinWidth ", pValue);
SCWrite(pCon, pBueffel, eError);
return 0;
} else {
@ -196,7 +196,7 @@ static int SQConfigure(pHistDriver self, SConnection * pCon,
}
}
if (fVal < 1) {
sprintf(pBueffel, "ERROR: %f is invalid for BinWidth", fVal);
snprintf(pBueffel,255, "ERROR: %f is invalid for BinWidth", fVal);
SCWrite(pCon, pBueffel, eError);
return 0;
}