mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-08 02:49:58 +00:00
ensure setValue stays within buffer size
This commit is contained in:
@@ -262,7 +262,8 @@ static void setValue( char * pSource, char dest[] )
|
||||
{
|
||||
// Destination is always one of our static buffers with size BUFSIZE
|
||||
memset( dest, 0, BUFSIZE );
|
||||
memcpy( dest, pSource, strlen(pSource) );
|
||||
int length = (strlen(pSource) < BUFSIZE - 1) ? strlen(pSource) : (BUFSIZE - 1);
|
||||
memcpy( dest, pSource, length );
|
||||
}
|
||||
|
||||
static void setDataDir(char *pData)
|
||||
|
||||
Reference in New Issue
Block a user