Joris van der Wel joris@jorisvanderwel.com writes:
- if (req->process_sd_size > get_req_data_size() ||
req->thread_sd_size > get_req_data_size() - req->process_sd_size ||
req->info_size > get_req_data_size() - req->process_sd_size - req->thread_sd_size)
- {
close( socket_fd );
return;
- }
You have to return an error.
- req_info = (const startup_info_t *)
((char*)get_req_data() + req->process_sd_size + req->thread_sd_size);
- req_env = (const WCHAR *)
((char*)get_req_data() + req->process_sd_size + req->thread_sd_size + req->info_size);
- req_env_size = get_req_data_size() - (req->process_sd_size + req->thread_sd_size + req->info_size);
These may not be valid pointers (alignment is not checked) so it would be better to avoid declaring them as variables.