summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-03-10 18:19:08 +0000
committerAndi Gutmans <andi@php.net>2000-03-10 18:19:08 +0000
commiteedd3ac4d09980e20111ae931bace1c798204e4c (patch)
tree6ab3913750d4ddfac0d9d061e82e0dc5d68d4ed6
parentf3cd07fe7d41cedd5680d09b96204eece898e502 (diff)
downloadphp-git-eedd3ac4d09980e20111ae931bace1c798204e4c.tar.gz
- Use strlcpy() insted of strcpy()
-rw-r--r--main/fopen_wrappers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 50f57dc7bc..ad3d35e602 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -100,7 +100,7 @@ PHPAPI int php_check_specific_open_basedir(char *basedir, char *path PLS_DC)
SG(request_info).path_translated &&
*SG(request_info).path_translated
) {
- strcpy(local_open_basedir, SG(request_info).path_translated);
+ strlcpy(local_open_basedir, SG(request_info).path_translated, sizeof(local_open_basedir));
local_open_basedir_pos = strlen(local_open_basedir) - 1;
/* Strip filename */
@@ -116,7 +116,7 @@ PHPAPI int php_check_specific_open_basedir(char *basedir, char *path PLS_DC)
}
} else {
/* Else use the unmodified path */
- strcpy(local_open_basedir, basedir);
+ strlcpy(local_open_basedir, basedir, sizeof(local_open_basedir));
}
/* Resolve the real path into resolved_name */
@@ -578,7 +578,7 @@ static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, in
}
if (!strncasecmp(tmp_line, "Location: ", 10)) {
- strcpy(location, tmp_line + 10);
+ strlcpy(location, tmp_line + 10, sizeof(location));
}
if (tmp_line[0] == '\0') {