- fixed some potential bugs introduced when replacing strncpy and
strncat by strlcpy and strlcat
This commit is contained in:
8
scan.c
8
scan.c
@ -1396,16 +1396,16 @@ static void PrintScanVars(pScanData self, char *scanname,
|
||||
assert(pCon);
|
||||
assert(self);
|
||||
|
||||
snprintf(pBueffel, 1023, "%s.scanvars = { ", scanname);
|
||||
snprintf(pBueffel, sizeof pBueffel, "%s.scanvars = { ", scanname);
|
||||
for (i = 0; i < self->iScanVar; i++) {
|
||||
DynarGet(self->pScanVar, i, &pPtr);
|
||||
pVar = (pVarEntry) pPtr;
|
||||
if (pVar != NULL) {
|
||||
strlcat(pBueffel, ScanVarName(pVar), 1023 - strlen(pBueffel));
|
||||
strcat(pBueffel, " ");
|
||||
strlcat(pBueffel, ScanVarName(pVar), sizeof pBueffel);
|
||||
strlcat(pBueffel, " ", sizeof pBueffel);
|
||||
}
|
||||
}
|
||||
strcat(pBueffel, "}");
|
||||
strlcat(pBueffel, "}", sizeof pBueffel);
|
||||
SCWrite(pCon, pBueffel, eValue);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user