summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sapi/thttpd/thttpd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index f65421270e..e949cc77d9 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -174,9 +174,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array ELS_DC SLS_DC
php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array ELS_CC PLS_CC);
php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array ELS_CC PLS_CC);
- buf[BUF_SIZE] = '\0';
-
- strncpy(buf, inet_ntoa(TG(hc)->client_addr.sa_in.sin_addr), BUF_SIZE);
+ strlcpy(buf, inet_ntoa(TG(hc)->client_addr.sa_in.sin_addr), sizeof(buf));
ADD_STRING("REMOTE_ADDR");
ADD_STRING("REMOTE_HOST");