]> granicus.if.org Git - php/commitdiff
Make sure string is NUL byte terminated.
authorGeorge Wang <gwang@php.net>
Mon, 10 Aug 2020 23:11:03 +0000 (19:11 -0400)
committerGeorge Wang <gwang@php.net>
Mon, 10 Aug 2020 23:11:03 +0000 (19:11 -0400)
sapi/litespeed/lsapilib.c

index 30abdd1bbe9c7f1b2f7fe4bfb58a7bc73de6d23e..b51e668223468f8887ac3dde4c8bed95f50ec794 100644 (file)
@@ -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 )
     {