[freeciv/freeciv] 9ace46: sdl: Fix widget_id truncation in widget lookup fun...

freeciv-commits <[email protected]> Wed, 11 Mar 2026 12:31:30 -0700
Newsgroups gmane.games.freeciv.devel
Message-ID <freeciv/freeciv/push/refs/heads/S3_3/[email protected]>
  Branch: refs/heads/S3_3
  Home:   https://github.com/freeciv/freeciv
  Commit: 9ace46afa519465a8e42947afa81e9ba3234240f
      https://github.com/freeciv/freeciv/commit/9ace46afa519465a8e42947afa81e9ba3234240f
  Author: Matt Jolly <[email protected]>
  Date:   2026-03-11 (Wed, 11 Mar 2026)

  Changed paths:
    M client/gui-sdl2/widget.c
    M client/gui-sdl2/widget.h
    M client/gui-sdl3/widget.c
    M client/gui-sdl3/widget.h

  Log Message:
  -----------
  sdl: Fix widget_id truncation in widget lookup functions

get_widget_pointer_from_id() and get_widget_pointer_from_main_list()
still used Uint16 id parameters after MAX_ID and widget_id were
widened to 32 bits in 7a187ce264. This caused silent truncation of
IDs like (MAX_ID - 1000 - style), making lookups fail and return
NULL, leading to a segfault in nation_button_callback.

See RM #1961

Signed-off-by: Matt Jolly <[email protected]>



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