ID: 13585 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: HTTP related Operating System: PHP Version: 4.0CVS-2001-10-07 New Comment:
Could you please explain also where this code fails? If you have some short example script too, that would help to see the whole picture. --Jani Previous Comments: ------------------------------------------------------------------------ [2001-10-07 07:40:48] [EMAIL PROTECTED] The following piece of code is taken from SAPI.C/sapi_add_header_ex it is obvious that this code is nonsense a) *ptr will point to \0 because someone forgot to increase it (the while loop will never be executed) b) the second condition in the while loop is redundant c) the size calculation should be done *after* the while loop ------------------------- colon_offset = strchr(header_line, ':'); if (colon_offset) { *colon_offset = 0; if (!STRCASECMP(header_line, "Content-Type")) { char *ptr = colon_offset, *mimetype = NULL, *newheader; size_t len = header_line_len - (ptr - header_line), newlen; while (*ptr == ' ' && *ptr != '\0') { ptr++; } mimetype = estrdup(ptr); .... -------------------------- ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13585&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]