Act nowcan affect a running systemAll seven non-merge commits are covered; two merge commits need no separate entries. The raw payload contains no superseded_by records, so still_moving is empty. The same-day JOP order comes from the embedded diffs and build progression. Version include bookkeeping was ignored, and surrounding source was inspected at the exact upstream commits.
Windows parent lookups stop leaking handles while JOP parsing hardens
GetParentProcess now closes its Windows process snapshot even when it finds the requested PID, preventing one handle from leaking per successful lookup. Five JOP fixes stop malformed conditionals, nested fallbacks and quoted template values from reading past their input or being parsed incorrectly. A low-level URL decoder is also exposed from mormot.core.buffers without changing its implementation.
TL;DR
- Repeated GetParentProcess calls on Windows no longer leak Toolhelp snapshot handles.
- Malformed JOP conditionals, nested fallbacks and unterminated strings now stop safely at the input boundary.
- Quoted JOP values preserve #, //, } and ] characters instead of treating them as syntax.
- DoUrlDecode is now public in mormot.core.buffers with its existing low-level signature.
Upgrade advice
Land on build 2.4.18076. Windows services that call GetParentProcess repeatedly should take the handle-leak fix, and applications using TextPreprocess or JsonPreprocess should take the complete JOP sequence through build 18075 rather than stopping on an intermediate parser fix.
7 of 7 entries · 9 commits upstream
1
High
A missing JOP $endif$ no longer walks beyond the input
TPreproc.DoSkip in mormot.core.fmt now checks the result of PosChar before passing it to ParseIfDollar. When no later '$' exists, it points P at NULCHAR and stops. A regression test confirms that an unterminated false $if block returns the preceding text instead of raising an access violation.
Fixes
mormot.core.fmt
be898be4+45-31
core: fixed missing $endif$ in JOP
Impact
Delphi and FPC applications that preprocess malformed JOP or text templates no longer risk an access violation solely because $endif$ is missing. Valid conditional output remains covered and unchanged.
Upgrade recommended
Take the complete JOP sequence through build 2.4.18075 and add malformed-template cases if templates come from external input.
Public API
TextPreprocessbehaviour-changed — An unterminated skipped conditional now stops at end of input instead of dereferencing a nil scan result.
Units
2
High
Unterminated nested JOP fallbacks stop at the closing boundary
TPreproc.Expand in mormot.core.fmt now advances across visible fallback text while searching for the expected ')' or '}' and increments the pointer only when that delimiter is present. Tests cover both a valid nested fallback and a missing outer parenthesis.
Fixes
mormot.core.fmt
26e29548+13-4
core: fixed unterminated nested JOP fallback can read past the input
Impact
A malformed nested fallback passed to TextPreprocess no longer advances beyond its terminating #0. Valid cascaded defaults keep resolving to the inner value on Delphi and FPC.
Upgrade recommended
Upgrade template-processing deployments to build 2.4.18075 or later and exercise nested default expressions with missing delimiters.
Units
3
High
Unterminated quoted JOP templates stop at #0
GotoTemplateEnding in mormot.core.fmt now checks for #0 immediately after GotoEndOfJsonString or GotoEndOfQuotedString returns. It exits before the unconditional pointer increment. Regression tests cover unterminated double-quoted and single-quoted object values.
Fixes
mormot.core.fmt
664175e6+13-2
core: fixed unterminated strings inside a JOP template
Impact
Malformed template objects with an open quote return an empty preprocessing result instead of reading beyond the string terminator. The fix applies to Delphi and FPC code using the JOP preprocessor.
Upgrade recommended
Take build 2.4.18075 or later when JOP templates may be incomplete, truncated or externally supplied.
Units
4
High
Windows parent-process lookups release their snapshot handle
RawProcessInfo in mormot.core.os.windows no longer exits from inside its Process32FirstW and Process32NextW loop. It records whether the PID matched, leaves the loop, and always calls CloseHandle on the Toolhelp snapshot. The Windows test calls GetParentProcess 30 times and checks that the process handle count stays bounded.
Fixes
mormot.core.os+1
15ea61a1+8-5
core: fixed GetParentProcess handle leak on Windows
Impact
A long-running Delphi or FPC Windows backend that repeatedly calls GetParentProcess no longer loses one kernel handle per successful lookup. Return values and the public signature are unchanged; non-Windows backends are unaffected.
Upgrade recommended
Upgrade Windows services that poll GetParentProcess or process ancestry, then repeat that path while monitoring the process handle count.
Public API
GetParentProcessbehaviour-changed — Successful Windows lookups now close their Toolhelp snapshot before returning.
5
Medium
Quoted JOP values keep hash and slash markers
TPreproc.DoRegister now recognizes # and // as comment starters only for pmTemplate values. Quoted or escaped JOP values keep those characters, including markers that follow an expanded variable. Three tests cover #, // and a variable followed by #tag.
Fixes
mormot.core.fmt
d20b42b4+24-3
core: fixed # and // inside quoted JOP DSL values treated as comments
Impact
JOP string values such as labels, fragments and URLs no longer lose text after # or // merely because a space precedes the marker. Template-level comments continue to work.
Units
6
Medium
Single-quoted JOP strings may contain closing braces
GotoTemplateEnding in mormot.core.fmt now sends a single quote to GotoEndOfQuotedString, just as double quotes already use GotoEndOfJsonString. Braces and brackets inside a single-quoted value therefore no longer change the template nesting level. A regression object contains 'a}b'.
Fixes
mormot.core.fmt
ad6c876a+11-2
core: fixed } or ] inside single-quoted template strings
Impact
JOP object and array templates containing } or ] inside single-quoted text are no longer cut short or structurally misread. Existing Delphi and FPC source code needs no migration.
Units
7
Low
The low-level URL decoder becomes callable by applications
mormot.core.buffers adds the existing DoUrlDecode(P, U: PByte; replace: AnsiChar): PUtf8Char declaration to its interface. The implementation at the end of the unit is unchanged; this commit only publishes the low-level routine used by the higher-level UrlDecode functions.
New features
mormot.core.buffers
01ca62ea+5-2
core: published DoUrlDecode() internal function
Impact
Delphi and FPC code can now call DoUrlDecode directly when it already manages mutable byte buffers and replacement rules. Existing callers of UrlDecode functions see no behavior change, and the pointer-level API requires the caller to provide valid buffer bounds.
Public API
DoUrlDecodeadded — The existing internal decoder is now declared in the unit interface with its pointer-level signature.