]> granicus.if.org Git - php/commitdiff
- Make all places use MAXPATHLEN in the same way. It includes the
authorAndi Gutmans <andi@php.net>
Sat, 16 Dec 2000 20:52:43 +0000 (20:52 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 16 Dec 2000 20:52:43 +0000 (20:52 +0000)
  terminating NULL.

ext/dba/dba.c
ext/standard/dir.c
main/fopen_wrappers.c
main/safe_mode.c
sapi/phttpd/phttpd.c
sapi/servlet/servlet.c

index c432b70018f281c59673864599874bf0f7433c7f..053861aadc90425e4806a97ec687a796bd9e47a3 100644 (file)
@@ -211,11 +211,21 @@ static PHP_MSHUTDOWN_FUNCTION(dba)
 static PHP_MINFO_FUNCTION(dba)
 {
        dba_handler *hptr;
+<<<<<<< dba.c
+       static char handlers[80];
+=======
        smart_str handlers = {0};
+>>>>>>> 1.28
+
+       handlers[0] = '\0';
 
        for(hptr = handler; hptr->name; hptr++) {
+<<<<<<< dba.c
+               strlcat(handlers, hptr->name, sizeof(handlers));
+=======
                smart_str_appends(&handlers, hptr->name);
                smart_str_appendc(&handlers, ' ');
+>>>>>>> 1.28
        }
 
        php_info_print_table_start();
index 131540816ad7df32d013b8f5414beee52d04725f..97f2ac89c608fd805ec9abb434849e23e50a4da0 100644 (file)
@@ -259,7 +259,7 @@ PHP_FUNCTION(getcwd)
        }
 
 #if HAVE_GETCWD
-       ret = V_GETCWD(path,MAXPATHLEN-1);
+       ret = V_GETCWD(path, MAXPATHLEN);
 #elif HAVE_GETWD
        ret = V_GETWD(path);
 /*
index 9f3ce6526c67753c161c79000b04c5499dc0cf1f..ec8a623021d53a75311551afccd84b8e6062e19d 100644 (file)
@@ -360,7 +360,7 @@ PHPAPI FILE *php_fopen_primary_script(void)
 PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path)
 {
        char *pathbuf, *ptr, *end;
-       char trypath[MAXPATHLEN + 1];
+       char trypath[MAXPATHLEN];
        struct stat sb;
        FILE *fp;
        int filename_length;
@@ -513,7 +513,7 @@ PHPAPI char *php_strip_url_passwd(char *url)
 PHPAPI char *expand_filepath(const char *filepath, char *real_path)
 {
        cwd_state new_state;
-       char cwd[MAXPATHLEN+1];
+       char cwd[MAXPATHLEN];
        char *result;
 
        result = V_GETCWD(cwd, MAXPATHLEN);     
index 1a11decc69462f0e3ca1f351b528fd873790630a..d8ae18fa12c06b0501782e8103aa711425b7882d 100644 (file)
@@ -106,7 +106,7 @@ PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode)
                }
                duid = sb.st_uid;
        } else {
-               char cwd[MAXPATHLEN+1];
+               char cwd[MAXPATHLEN];
                if (!V_GETCWD(cwd, MAXPATHLEN)) {
                        php_error(E_WARNING, "Unable to access current working directory");
                        return 0;
index 825fd2a3b508cb4c03b8b2d82315885857111dae..a7abe610886e7de3bd9e688f434a1981fb1a83dd 100644 (file)
@@ -203,7 +203,7 @@ php_phttpd_request_ctor(PHLS_D SLS_DC)
 
     SG(request_info).query_string = PHG(cip)->hip->request;
     SG(request_info).request_method = PHG(cip)->hip->method;
-       SG(request_info).path_translated = malloc(MAXPATHLEN+1);
+       SG(request_info).path_translated = malloc(MAXPATHLEN);
     SG(sapi_headers).http_response_code = 200;
        if (url_expand(PHG(cip)->hip->url, SG(request_info).path_translated, MAXPATHLEN, &PHG(sb), NULL, NULL) == NULL) {
                /* handle error */
index 04a51798de9c7168edead8157cf6d17142026dab..210e59c9b93658709161d19774f03444a545e104 100644 (file)
@@ -327,7 +327,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
 
        zend_file_handle file_handle;
 #ifndef VIRTUAL_DIR
-       char cwd[MAXPATHLEN+1];
+       char cwd[MAXPATHLEN];
 #endif
        SLS_FETCH();
        PLS_FETCH();