From: George Wang Date: Mon, 10 Aug 2020 23:11:03 +0000 (-0400) Subject: Make sure string is NUL byte terminated. X-Git-Tag: php-7.3.22RC1~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07cb2755bec2fe4671b35defc9e76f495ce6e9d1;p=php Make sure string is NUL byte terminated. --- diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 30abdd1bbe..b51e668223 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -2622,7 +2622,8 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr ) while( isspace( *pBind ) ) ++pBind; - strncpy( achAddr, pBind, 256 ); + strncpy(achAddr, pBind, 255); + achAddr[255] = 0; switch( *p ) {