|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-10-28 17:15 UTC] sniper@php.net
[2001-11-18 10:06 UTC] sander@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Feb 20 03:00:01 2026 UTC |
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); .... --------------------------