Re: [PATCH] http-backend: Don't infinite loop during die()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 22, 2010, 20:25 UTC
- Message-ID
- <7vhbo885os.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20100322142204.GB8916@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 5 quoted lines
> If stdout has already been closed by the CGI and die() gets called, > the CGI will fail to write the "Status: 500 Internal Server Error" to > the pipe, which results in die() being called again (via safe_write). > This goes on in an infinite loop until the stack overflows and the > process is killed by SIGSEGV.
Before looking at the code I first thought "wouldn't we have the same problem in die(), and shouldn't we have "dying" flag there?" but I was stupid as usual ;-)
The patch looks sane. Thanks.