Skip to content

sapi_send_headers bug #8162

@alexlongguo

Description

@alexlongguo

Description

version:php 7.4.27
file: SAPI.c
function: sapi_send_headers
code:

	if (sapi_module.send_headers) {
		retval = sapi_module.send_headers(&SG(sapi_headers));
	} else {
		retval = SAPI_HEADER_DO_SEND;
	}

	switch (retval) {
		case SAPI_HEADER_DO_SEND: {
				......
				sapi_module.send_header(&http_status_line, SG(server_context));
			}

describe:
I didn't set sapi_module.send_headers in sapi_module_struct, so this function is NULL.
retval = SAPI_HEADER_DO_SEND;
But call sapi_module.send_header in this switch,it could cause crash.

PHP Version

php 7.4.27

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions