Article View: comp.os.vms
Article #228Re: More PHP vulnerabilities
From: Arne Vajhøj
Date: Sat, 21 Nov 2026 22:32
Date: Sat, 21 Nov 2026 22:32
98 lines
3290 bytes
3290 bytes
On 11/20/2026 3:24 PM, Arne Vajhøj 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...
>>
>> Don't be surprised if everyone is now looking for similar constructs
>> that rely on short-circuiting to be safe.
>
> Doesn't C require/mandate short circuiting in cases like this??
I believe the VMS landscape looks like:
Undefined(*) L to R L to R
all short circuit
VMS Fortran .and.
.or.
VMS Pascal and and_then
or or_else
C & &&
| ||
Ada and and then
or or else
Java & &&
| ||
Python & and
| or
PHP & &&
| ||
and(**)
or(**)
*) do not use with anything with side effects
**) do not use ever
Example of undefined with VMS Pascal and /OPT vs /NOOPT:
$ type demo.pas
program demo(input,output);
function ff : boolean;
begin
writeln('ff');
ff := false;
end;
function tf : boolean;
begin
writeln('tf');
tf := true;
end;
var
res : boolean;
begin
res := ff and tf;
writeln('ff and tf', res);
res := ff and_then tf;
writeln('ff and_then tf', res);
res := tf or ff;
writeln('tf or ff', res);
res := tf or_else ff;
writeln('tf or_else ff', res);
end.
$ pas demo
$ lin demo
$ r demo
ff
ff and tf FALSE
ff
ff and_then tf FALSE
tf
tf or ff TRUE
tf
tf or_else ff TRUE
$ pas/noop demo
$ lin demo
$ r demo
ff
tf
ff and tf FALSE
ff
ff and_then tf FALSE
tf
ff
tf or ff TRUE
tf
tf or_else ff TRUE
Arne
Technical Details
Message-ID:
<6b021bab$0$672$14726298@news.sunsite.dk>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mailReferences:
<11dnpep$2kvk6$2@dont-email.me> <11dpfjf$35umc$1@dont-email.me> <11dq9gg$3ghpm$1@dont-email.me> <11dqa7g$3guqc$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Sat, 21 Nov 2026 17:32:01 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: More PHP vulnerabilities Newsgroups: comp.os.vms 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> Content-Language: en-US From: Arne Vajhøj <arne@vajhoej.dk> In-Reply-To: <11dqa7g$3guqc$1@dont-email.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Lines: 98 Message-ID: <6b021bab$0$672$14726298@news.sunsite.dk> Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: cd9240ab.news.sunsite.dk X-Trace: 1795300267 news.sunsite.dk 672 arne@vajhoej.dk/70.172.216.99:51690 X-Complaints-To: staff@sunsite.dk