]> granicus.if.org Git - php/commitdiff
fix buffer overrun
authorAntony Dovgal <tony2001@php.net>
Mon, 20 Mar 2006 14:10:23 +0000 (14:10 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 20 Mar 2006 14:10:23 +0000 (14:10 +0000)
ext/standard/ftp_fopen_wrapper.c

index 4daa0c0e930469fc0036ef4355432d634e61ddb8..871250f7deb11e5ef8b1c5fb8ce03119a1f211e8 100644 (file)
@@ -611,7 +611,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
 
        tmp_len = MIN(sizeof(ent->d_name), basename_len - 1);
        memcpy(ent->d_name, basename, tmp_len);
-       ent->d_name[tmp_len] = '\0';
+       ent->d_name[tmp_len - 1] = '\0';
        efree(basename);
 
        /* Trim off trailing whitespace characters */