[mapserver-commits] [MapServer/MapServer] b3e114: Fix(parser): Prevent crash with non-existent layer...

Māris Nartišs noreply at github.com
Mon Sep 29 07:19:48 PDT 2025


  Branch: refs/heads/backport-7334-to-branch-8-4
  Home:   https://github.com/MapServer/MapServer
  Commit: b3e1141371fce0f265fa79389cd15c6615522089
      https://github.com/MapServer/MapServer/commit/b3e1141371fce0f265fa79389cd15c6615522089
  Author: Māris Nartišs <maris.gis at gmail.com>
  Date:   2025-09-29 (Mon, 29 Sep 2025)

  Changed paths:
    M src/maputil.c

  Log Message:
  -----------
  Fix(parser): Prevent crash with non-existent layer in REQUIRES

When a REQUIRES or LABELREQUIRES expression contains a reference to
a layer that does not exist in the mapfile, the expression parser would
treat it as an attribute binding. Since msEvalContext is called without
a shape object, this would lead to a NULL pointer dereference and a
crash when the parser tried to evaluate the binding.
This patch adds a check after tokenizing the expression to ensure no
attribute binding tokens are present. If any are found, it indicates
a reference to a non-existent layer. An error is reported and the
evaluation returns MS_FALSE, preventing the crash.

Fix generated by gemini-2.5-pro


  Commit: ce5771b796db619e1d089ef608d4983fd687c2ed
      https://github.com/MapServer/MapServer/commit/ce5771b796db619e1d089ef608d4983fd687c2ed
  Author: Māris Nartišs <maris.gis at gmail.com>
  Date:   2025-09-29 (Mon, 29 Sep 2025)

  Changed paths:
    M msautotest/query/context.map
    A msautotest/query/expected/context_test004.png
    A msautotest/query/expected/context_test005.png

  Log Message:
  -----------
  Add tests with non existant REQUIRES parameter triggering a failure


Compare: https://github.com/MapServer/MapServer/compare/b3e1141371fc%5E...ce5771b796db

To unsubscribe from these emails, change your notification settings at https://github.com/MapServer/MapServer/settings/notifications


More information about the MapServer-commits mailing list