[Freeciv-tickets] [freeciv] #48379: sdl2: real_units_report_dialog_update() pbuf NULL dereference

Back to archive index
OSDN Ticket System norep****@osdn*****
Sun Jul 16 17:35:23 JST 2023


#48379: sdl2: real_units_report_dialog_update() pbuf NULL dereference

  Open Date: 2023-07-10 06:59
Last Update: 2023-07-16 11:35

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/48379
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48379

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2023-07-16 11:35 Updated by: cazfi
 * Status Update from Open to Closed
 * Resolution Update from Accepted to Fixed


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: cazfi
          Type: Bugs
        Status: Closed
      Priority: 5 - Medium
     MileStone: 3.0.9
     Component: SDL2-client
      Severity: 5 - Medium
    Resolution: Fixed
---------------------------------------------------------------------

Ticket details:

S3_1, clang analyzer:
../../../../src/client/gui-sdl2/repodlgs.c:946:25: warning: Access to field 'id' results in a dereference of a null pointer (loaded from variable 'pbuf') [core.NullDereference]
          if ((MAX_ID - pbuf->id) == utype_number(i)) {
                        ^~~~~~~~
Seems actual bug to me. pbuf gets assigned from pwidget which has been assigned (initially) from units_dlg->end_active_widget_list, that might has no value assigned at all since fc_calloc() set it NULL. That can happen when the player has no units at all.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/48379
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=48379



More information about the Freeciv-tickets mailing list
Back to archive index