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);
/* 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);
}
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) {