thetaphi Sat Jun 26 06:30:08 2004 EDT Modified files: /php-src/sapi/nsapi nsapi.c Log: replace strncpy with strlcpy http://cvs.php.net/diff.php/php-src/sapi/nsapi/nsapi.c?r1=1.62&r2=1.63&ty=u Index: php-src/sapi/nsapi/nsapi.c diff -u php-src/sapi/nsapi/nsapi.c:1.62 php-src/sapi/nsapi/nsapi.c:1.63 --- php-src/sapi/nsapi/nsapi.c:1.62 Wed Jun 23 09:02:01 2004 +++ php-src/sapi/nsapi/nsapi.c Sat Jun 26 06:30:07 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: nsapi.c,v 1.62 2004/06/23 13:02:01 thetaphi Exp $ */ +/* $Id: nsapi.c,v 1.63 2004/06/26 10:30:07 thetaphi Exp $ */ /* * PHP includes @@ -310,7 +310,7 @@ PHP_MINFO_FUNCTION(nsapi) { php_info_print_table_start(); - php_info_print_table_row(2, "NSAPI Module Revision", "$Revision: 1.62 $"); + php_info_print_table_row(2, "NSAPI Module Revision", "$Revision: 1.63 $"); php_info_print_table_row(2, "Server Software", system_version()); php_info_print_table_row(2, "Sub-requests with nsapi_virtual()", (nsapi_servact_service)?((zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0))?"not supported with zlib.output_compression":"enabled"):"not supported on this platform" ); @@ -604,7 +604,7 @@ while (entry) { if (!PG(safe_mode) || strncasecmp(entry->param->name, "authorization", 13)) { if (strcasecmp(entry->param->name, "content-length")==0 || strcasecmp(entry->param->name, "content-type")==0) { - strncpy(buf, entry->param->name, NS_BUF_SIZE); + strlcpy(buf, entry->param->name, NS_BUF_SIZE); pos = 0; } else { snprintf(buf, NS_BUF_SIZE, "HTTP_%s", entry->param->name); @@ -672,8 +672,7 @@ /* Create full Request-URI & Script-Name */ if (SG(request_info).request_uri) { - strncpy(buf, SG(request_info).request_uri, NS_BUF_SIZE); - buf[NS_BUF_SIZE]='\0'; + strlcpy(buf, SG(request_info).request_uri, NS_BUF_SIZE); if (SG(request_info).query_string) { p = strchr(buf, 0); snprintf(p, NS_BUF_SIZE-(p-buf), "?%s", SG(request_info).query_string); @@ -681,8 +680,7 @@ } php_register_variable("REQUEST_URI", buf, track_vars_array TSRMLS_CC); - strncpy(buf, SG(request_info).request_uri, NS_BUF_SIZE); - buf[NS_BUF_SIZE]='\0'; + strlcpy(buf, SG(request_info).request_uri, NS_BUF_SIZE); if (rc->path_info) { pos = strlen(SG(request_info).request_uri) - strlen(rc->path_info); if (pos>=0 && pos<=NS_BUF_SIZE && rc->path_info) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php