🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.vms
Article #241

Re: More PHP vulnerabilities

#241
From: Arne Vajhøj
Date: Mon, 23 Nov 2026 21:38
59 lines
3225 bytes
On 11/23/2026 2:42 PM, Simon Clubley wrote:
> On 2026-11-20, Arne Vajhøj <arne@vajhoej.dk> wrote:
>> On 11/20/2026 3:10 PM, Simon Clubley wrote:
>>> On 2026-11-20, Arne Vajhøj <arne@vajhoej.dk> wrote:
>>>> And for the curious - before fix:
>>>>
>>>> use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 4) &&
>>>> ZSTR_VAL(resource->scheme)[4] == 's';
>>>
>>> I really hope that line was always compiled by a short-circuiting
>>> compiler and that line always successfully triggered short-circuiting...

>> Doesn't C require/mandate short circuiting in cases like this??
>>
> 
> As Dan has pointed out, yes. However, I absolutely hate that style of
> coding (and the use of short circuiting in general) - it is way too fragile.
> 
> It depends on the compiler behaving as expected and it depends on someone
> not making some edit change that happens to have the unexpected side-effect
> of disabling any working short circuiting.
> 
> Seriously. Please consider not using short circuiting and instead writing
> your code so it works regardless of whether your compiler short-circuits
> or not. (Or it suddenly decides to stop short-circuiting one day).
In general coding to protect against potential compiler
bugs seems futile to me.

Compiler bugs does happen, but this seems like a very
unlikely one to happen.

I know unlikely <> impossible, but preparing for
unlikely compiler bugs does not make sense to me.

I would be more attracted to the readability argument.

That:

IF e1 AND e2 THEN
     ...
END IF

would be more readable as:

IF e1 THEN
     IF e2 THEN
         ...
     END IF
END IF

Because even though it seems highly unlikely that compiler writers
does not know the rules for short circuit in the language they are
implementing, then it could definitely happen that the
application writer using the compiler does not.

Arne


Technical Details
Message-ID: <11e2bn0$297op$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11dnpep$2kvk6$2@dont-email.me> <11dpfjf$35umc$1@dont-email.me> <11dq9gg$3ghpm$1@dont-email.me> <11dqa7g$3guqc$1@dont-email.me> <11e24vp$265v0$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Arne Vajhøj <arne@vajhoej.dk>
Newsgroups: comp.os.vms
Subject: Re: More PHP vulnerabilities
Date: Mon, 23 Nov 2026 16:38:33 -0500
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <11e2bn0$297op$1@dont-email.me>
References: <11dnpep$2kvk6$2@dont-email.me> <11dpfjf$35umc$1@dont-email.me>
 <11dq9gg$3ghpm$1@dont-email.me> <11dqa7g$3guqc$1@dont-email.me>
 <11e24vp$265v0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 23 Nov 2026 21:37:37 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2400025"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX188PXo+YjiS7USGNSXxginLg/ip8M34L2Y="; posting-host="16d09144d1cc0e4741f54b4343bcb270"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gaAf+ebjcm8v5C7/O4rtNjnRSnA= sha256:MxFVH4Kr0ZM9ICDL1kbzPABJRWCSAXWvfqI+AdyYj/o=
	sha1:/+YVWkJSM4caCD8fW6yxaRoGwEs= sha256:0esPTM/H42FSynjwyJByetzSviW2zCQNAfUbTDnTkH4=
Content-Language: en-US
In-Reply-To: <11e24vp$265v0$1@dont-email.me>