ID:               17566
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Apache2 related
 Operating System: BSD/OS 4.2
 PHP Version:      4.4-dev
 New Comment:

PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen,
int *newlen, int all, int quote_style, char *hint_char
set TSRMLS_DC)
{
    int i, j, maxlen, len;
    char *replaced;
    enum entity_charset charset = determine_charset(hint_charset
TSRMLS_CC);
    int matches_map;

    maxlen = 2 * oldlen;
    if (maxlen < 128)
        maxlen = 128;    replaced = emalloc (maxlen); // #line 667
    len = 0;

    i = 0;
    while (i < oldlen) {
....

        }           
    }
    replaced[len] = '\0';
...


So what happens if oldlen = 0 and more importantly: how can oldlen
become 0?


Previous Comments:
------------------------------------------------------------------------

[2002-10-06 23:01:29] [EMAIL PROTECTED]

hmm......that is a hint:
/home/mdev/cvs/php4/ext/standard/html.c(667) :  Freeing 0x0820BA24 (396
bytes), script=-
Last leak repeated 383 times

383 times?

------------------------------------------------------------------------

[2002-10-06 22:57:30] [EMAIL PROTECTED]

No change at all.
Apache 2.0.43.

load averages:  6.81,  3.75,  1.91
149 processes: 2 running, 147 sleeping
CPU states:  0.2% user,  0.0% nice,  0.2% system,  0.0% interrupt,
99.6% idle
Memory: Real: 318M/397M Virt: 440M/1252M Free: 477M


------------------------------------------------------------------------

[2002-09-29 22:55:17] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip



------------------------------------------------------------------------

[2002-06-03 08:08:11] [EMAIL PROTECTED]

About the Apache-2 comment:
I haven't been able to use it for anything else than an image server,
since neither mod_perl nor php work well.

Indeed - threads and dynamic linking are a different flavour on BSD/OS.
SIGHUP and SIGUSR are broken in apache2 without php as well, but they
do a SIGTERM/SIGKILL and are then able to restart. With php compiled in
this breaks with a segfault.

Configure options:

$ cat ../httpd-2.0.36/configure-cmd.sh ./configure-cmd.sh
#!/bin/bash

CFLAGS=-g \
./configure \
        --prefix=/aphack2 \
        --disable-threads \
        --with-port=8080 \
        --with-mpm=prefork \
        --disable-file-cache \
        --enable-charset-lite \
        --disable-cache \
        --disable-disk-cache \
        --disable-mem-cache \
        --enable-ext-filter \
        --enable-deflate \
        --with-z=/weblib/local \
        --disable-include \
        --enable-expires \
        --enable-headers \
        --enable-usertrack \
        --enable-unique-id \
        --disable-proxy \
        --disable-proxy-connect \
        --disable-proxy-ftp \
        --disable-proxy-http \
        --disable-ssl \
        --enable-http \
        --enable-info \
        --enable-cgi \
        --enable-speling \
        --disable-rewrite \
        --enable-so \
        --enable-dav=no \
        --enable-shared=max
#!/bin/bash

SHELL=/bin/bash \
./configure \
        --prefix=/phphack2 \
        --with-config-file-path=/phphack2/lib \
        --enable-debug \
        --enable-magic-quotes \
        --enable-sockets \
        --enable-cli \
        --enable-session \
        --disable-short-tags \
        --with-apxs2=/aphack2/bin/apxs \
        --with-mysql=/weblib/local \
        --with-pear \
        --without-xml \
        --with-pic \
        --without-tsrm

------------------------------------------------------------------------

[2002-06-03 07:36:39] [EMAIL PROTECTED]

What were the configure lines for both Apache2 and PHP ??
Someone said that Apache2 doesn't quite work with BSD? 
(depends which MPM is used)


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/17566

-- 
Edit this bug report at http://bugs.php.net/?id=17566&edit=1

Reply via email to