Skip to content

Commit 07cb275

Browse files
author
George Wang
committed
Make sure string is NUL byte terminated.
1 parent 4723bd4 commit 07cb275

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sapi/litespeed/lsapilib.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,8 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr )
26222622
while( isspace( *pBind ) )
26232623
++pBind;
26242624

2625-
strncpy( achAddr, pBind, 256 );
2625+
strncpy(achAddr, pBind, 255);
2626+
achAddr[255] = 0;
26262627

26272628
switch( *p )
26282629
{

0 commit comments

Comments
 (0)