[mapserver-commits] [MapServer/MapServer] 342b04: Fix(parser): Prevent crash with non-existent layer...
Māris Nartišs
noreply at github.com
Mon Sep 29 07:19:34 PDT 2025
Branch: refs/heads/main
Home: https://github.com/MapServer/MapServer
Commit: 342b0428476438a9c31923a99832f004c9ece37e
https://github.com/MapServer/MapServer/commit/342b0428476438a9c31923a99832f004c9ece37e
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
M src/maputil.c
Log Message:
-----------
Fix(parser): Prevent crash with non-existent layer in REQUIRES (#7334)
* 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
* Add tests with non existant REQUIRES parameter triggering a failure
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