mORMot2 DailyDaily read of upstream commits

LDAP bounds checks and nullable SOA metadata

LDAP attribute reads now reject negative indexes instead of indexing before their value array. The SOA code-generation context also reports the exact TNullable* variant kind, giving custom generators and templates enough metadata to distinguish nullable values.

TL;DR

  • TLdapAttribute.GetReadable now returns an empty value for negative indexes, matching its existing out-of-range contract.
  • TWrapperContextRest adds a numeric nullable field to variant descriptions and identifies every TNullable* kind from RTTI.

Upgrade advice

Land on build 18239 at eecb753daa890a12d5dc93d9c6de2357db78c4bc. LDAP users gain the bounds fix, while the additive SOA metadata should only require attention from teams maintaining custom code-generation templates.

Build2.4.18232 → 2.4.18239
Commits3
Lines+26 -5
Read1 min

2 of 2 entries · 3 commits upstream

# Entry Category Units
1 Medium Negative LDAP attribute indexes no longer read before the value array In mormot.net.ldap, TLdapAttribute.GetReadable now converts both index and fCount to PtrUInt for its range comparison. Any negative PtrInt therefore becomes an unsigned value above the valid range and follows the same empty-result path as an index greater than or equal to Count. The check now matches TLdapAttribute.GetRaw, which already used this unsigned comparison. Fixes mormot.net.ldap bf85a90a+1-1

ldap - Fix invalid range in TLdapAttribute.GetReadable

Impact

Previously, a negative index passed the index >= fCount test and was used as fList[index], which could read outside the dynamic array and raise an access violation or expose an unrelated value. Delphi and FPC LDAP backends now receive an empty RawUtf8 for any invalid negative index. Valid indexes and attribute conversion behaviour are unchanged.

Public API

  • TLdapAttribute.GetReadablebehaviour-changed — Both overloads now return an empty value for a negative index instead of accessing fList before its first element.

tprudhomme · 12:48 UTC · view the commit on GitHub →

2 Low SOA variant descriptions now identify each nullable storage kind In mormot.core.interfaces, TWrapperContext gains the protected virtual AfterContextSet hook, called after ContextFromRtti has assembled a type description. TWrapperContextRest in mormot.soa.codegen overrides it for wVariant and adds nullable as ord(NullableVariantType(rtti.Info)). Values are nvtNone through nvtUtf8Text, so TNullableInteger, TNullableBoolean, TNullableFloat, TNullableCurrency, TNullableDateTime, TNullableTimeLog and TNullableUtf8Text can be distinguished from an ordinary variant. New features mormot.core.interfaces+2 8d2cdead+24-3

soa: include "nullable" field for variant code description

Impact

Delphi and FPC services using the standard generated code keep the same Pascal runtime types. Custom SOA generators or Mustache templates receive one additional numeric nullable field on variant contexts with RTTI; they can use it to generate nullable-aware declarations, while consumers that ignore unknown fields remain compatible.

Worth a look

If you maintain custom SOA templates, regenerate one interface containing each TNullable* type and verify how the numeric nullable field is consumed. No application-code migration is required.

Public API

  • TWrapperContext.AfterContextSetadded — This protected virtual hook lets TWrapperContext descendants append fields after ContextFromRtti builds a type context.

Arnaud · 14:56 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits1007
Active days49/60
Busiest2026-09-30
Peak60
2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 12 commits2026-10-11: 2 commits2026-10-12: 40 commits2026-10-13: 31 commits2026-10-14: 23 commits2026-10-15: 16 commits2026-10-16: 27 commits2026-10-17: 0 commits2026-10-18: 0 commits2026-10-19: 0 commits2026-10-20: 0 commits2026-10-21: 0 commits2026-10-22: 3 commits2026-10-23: 6 commits2026-10-24: 29 commits2026-10-25: 7 commits2026-10-26: 25 commits2026-10-27: 4 commits2026-10-28: 8 commits2026-10-29: 17 commits2026-10-30: 20 commits2026-10-31: 0 commits2026-11-01: 0 commits2026-11-02: 16 commits2026-11-03: 32 commits2026-11-04: 15 commits2026-11-05: 32 commits2026-11-06: 26 commits2026-11-07: 19 commits2026-11-08: 2 commits2026-11-09: 29 commits2026-11-10: 17 commits2026-11-11: 8 commits2026-11-12: 38 commits2026-11-13: 39 commits2026-11-14: 9 commits2026-11-15: 6 commits2026-11-16: 21 commits2026-11-17: 30 commits2026-11-18: 37 commits2026-11-19: 28 commits2026-11-20: 31 commits2026-11-21: 0 commits2026-11-22: 0 commits2026-11-23: 1 commit2026-11-24: 6 commits2026-11-25: 3 commits2026-11-26: 3 commits2026-11-27: 0 commits2026-11-28: 0 commits
2026-09-302026-11-28