[freeciv/freeciv] 038fb1: sdl: Fix widget_id truncation in widget lookup fun...

freeciv-commits <[email protected]> Wed, 11 Mar 2026 19:31:09 +0000 (UTC)
Newsgroups gmane.games.freeciv.devel
Message-ID <freeciv/freeciv/push/refs/heads/main/[email protected]>
  Branch: refs/heads/main
  Home:   https://github.com/freeciv/freeciv
  Commit: 038fb1e984f039de4d71df631c91f46e860d7b3d
      https://github.com/freeciv/freeciv/commit/038fb1e984f039de4d71df631c91f46e860d7b3d
  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