- After a bug at TRICS I replaced all occurrences of strcpy, strcat, sprintf
by length limited versions wherever appropriate.
This commit is contained in:
4
lmd200.c
4
lmd200.c
@ -120,7 +120,7 @@ static int countTokens(char *lineBuffer)
|
||||
|
||||
|
||||
memset(myBuffer, 0, BUFLEN);
|
||||
strcpy(myBuffer, lineBuffer);
|
||||
strncpy(myBuffer, lineBuffer,BUFLEN);
|
||||
pPtr = myBuffer;
|
||||
pPtr = stptok(pPtr, token, 60, " \r\n");
|
||||
while (pPtr != NULL) {
|
||||
@ -178,7 +178,7 @@ static int LMD200Callback(int handle, void *userData)
|
||||
pEnd = strchr(pPtr,(int)'\r');
|
||||
while(pEnd != NULL){
|
||||
*pEnd = '\0';
|
||||
strcpy(priv->lineBuffer,pPtr);
|
||||
strncpy(priv->lineBuffer,pPtr,BUFLEN);
|
||||
interpretLine(self,priv);
|
||||
ANETreadConsume(priv->asChannel,(pEnd - pPtr)+1);
|
||||
pPtr = ANETreadPtr(priv->asChannel,&length);
|
||||
|
Reference in New Issue
Block a user