URL:
  <http://gna.org/bugs/?16800>

                 Summary: Segmentation fault in unit_type()
                 Project: Freeciv
            Submitted by: syntron
            Submitted on: Samstag 02.10.2010 um 13:06
                Category: general
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: trunk
         Discussion Lock: Any
        Operating System: None
         Planned Release: 2.3.0

    _______________________________________________________

Details:


Core was generated by `./server/freeciv-server -r ./test016.serv -d 3 -l
./test016.log -p 6789'.
Program terminated with signal 11, Segmentation fault.
#0  unit_type (punit=0x0) at unittype.c:139
139     {
(gdb) bt full
#0  unit_type (punit=0x0) at unittype.c:139
No locals.
#1  0x00000000004f8754 in can_unit_transport (transporter=0x0,
transported=<value optimized out>)
    at movement.c:507
No locals.
#2  0x000000000049246b in check_units (file=0x5c02b8 "srv_main.c",
function=0x5c0fcc "begin_turn",
    line=765) at sanitycheck.c:427
        pcity = <value optimized out>
        phome = <value optimized out>
        transporter2 = (struct unit *) 0xbd9d70
        ptile = (struct tile *) 0xd13298
        transporter = (struct unit *) 0x0
        myiter = (const struct genlist_link *) 0x1530c60
        punit = (struct unit *) 0x1530ad0
        pplayer = (struct player *) 0xfd5e30
        _pslot = (struct player_slot *) 0xa68698
        __FUNCTION__ = "check_units"
#3  0x000000000049433e in real_sanity_check (file=0x5c02b8 "srv_main.c",
function=0x5c0fcc "begin_turn",
    line=765) at sanitycheck.c:561
No locals.
#4  0x000000000040c85b in srv_main () at srv_main.c:765
        __FUNCTION__ = "srv_main"
#5  0x00000000004040c9 in main (argc=9, argv=0x7fff4ae53178) at
civserver.c:372
        inx = 9
        showhelp = false
        showvers = false
        option = <value optimized out>
        __FUNCTION__ = "main"


The function can_unit_transport() could be called with transporter == NULL in
sanitycheck.c:check_units(). A proposal for a patch catching this is
attached.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Samstag 02.10.2010 um 13:06  Name:
20101002-trunk-check-for-NULL-pointer-in-can_unit_transport.patch  Size: 1kB 
 By: syntron

<http://gna.org/bugs/download.php?file_id=10546>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?16800>

_______________________________________________
  Nachricht geschickt von/durch Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to