Files
zoneminder/web/includes
SteveGilvarry a918735e9c fix: correct stale SharedData and TriggerData offsets in PHP shm map
The PHP shared memory map in web/includes/Monitor.php was not updated
when last_analysis_viewed_time was added to SharedData (zm_monitor.h,
offset +152), so every field from control_state onward was read 8 bytes
early: control_state, alarm_cause, video_fifo, audio_fifo and janus_pin.
The TriggerData base offset (864) had been updated, so only the
SharedData tail was skewed. The error goes undetected because connect()
only checks the 'valid' byte at +88, which sits in the unaffected
region, and never compares the 'size' field.

Also corrects the TriggerData showtext offset: 'text' is 256 bytes at
912, so 'showtext' starts at 1168, not 1268.

The Perl map (Memory.pm.in) computes offsets from the field sequence
and is unaffected.

Tests: php -l passes; offsets verified field-by-field against the
SharedData struct in src/zm_monitor.h on master.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 15:06:38 +10:00
..
2026-01-31 21:01:00 -05:00