ID:               27383
 Comment by:       iceberg64_2001 at yahoo dot com
 Reported By:      remijnj at eidetica dot com
 Status:           Closed
 Bug Type:         HTTP related
 Operating System: Linux (Slackware 9.1)
 PHP Version:      4.3.5RC3
 New Comment:

I have a problem with my pc. Everytime im on the internet a Microsoft
Visual c++ runtime library error tag will come up. I dont know i why.
Can anyone help me?


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

[2004-02-25 18:56:37] [EMAIL PROTECTED]

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



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

[2004-02-25 17:47:09] remijnj at eidetica dot com

It does reach that line if php_stream_eof(stream) evaluates to true
(seems to happen if the sending of the request times out or something).
I've seen it happen and my patch easily fixes the problem of printing
uninitialized data in that does not contain any '\0' char.

I'm not sure how the code all works but i've seen this exact error with
the "HTTP request failed!" bit and i don't see this string anywhere else
in the source so i'm pretty sure it reaches it. I could be mistaken
about why it is still unitialized though. 

Point is i have applied this patch in our server and the errors are now
printed without the "garbage" bytes.

Joost

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

[2004-02-25 16:30:23] [EMAIL PROTECTED]

In the CVS it cannot reach that line, if tmp_line is < 9 
then response_code is set to 0 and the code terminates 
before that line is reached. In all other instances 
tmp_line will contain a null terminated string. 

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

[2004-02-25 15:09:45] remijnj at eidetica dot com

I reopened the bug because the tmp_line is still not initialized. See
my previous comment (forgot to open the bug again) which has a simple
patch from cvs diff -u.

Joost

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

[2004-02-24 17:51:34] remijnj at eidetica dot com

Thanks for adding it to CVS so quickly. I got the cvs version checked
out now and i notice one important bit missing (because i didn't
explain it properly i guess).

My initial problem (garbage bytes in "HTTP request failed" error) is
still there as far as i can see from the code. Let me explain.

The line :
php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request
failed! %s", tmp_line);

can be reached with tmp_line uninitialized. That is why i added the
'tmp_line[0] = '\0';' at the start of the function. Here an incremental
patch on top of this.

Index: ext/standard/http_fopen_wrapper.c
===================================================================
RCS file: /repository/php-src/ext/standard/http_fopen_wrapper.c,v
retrieving revision 1.53.2.15
diff -u -r1.53.2.15 http_fopen_wrapper.c
--- ext/standard/http_fopen_wrapper.c   24 Feb 2004 21:53:56 -0000     
1.53.2.15
+++ ext/standard/http_fopen_wrapper.c   24 Feb 2004 22:51:56 -0000
@@ -107,6 +107,8 @@
        size_t chunk_size = 0, file_size = 0;
        int eol_detect, have_header = 0;

+       tmp_line[0] = '\0';
+
        if (redirect_max < 1) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Circular
redirect, aborting.");
                return NULL;

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

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/27383

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

Reply via email to