[GRASS-dev] [GRASS GIS] #2438: Vect_get_line_type cannot handle line out of range

GRASS GIS trac at osgeo.org
Wed Oct 1 14:06:12 PDT 2014


#2438: Vect_get_line_type cannot handle line out of range
--------------------------+-------------------------------------------------
  Reporter:  artegion     |       Owner:  grass-dev@…              
      Type:  defect       |      Status:  closed                   
  Priority:  normal       |   Milestone:  6.4.5                    
 Component:  LibVector    |     Version:  unspecified              
Resolution:  invalid      |    Keywords:                           
  Platform:  Unspecified  |         Cpu:  Unspecified              
--------------------------+-------------------------------------------------
Changes (by mmetz):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 Replying to [ticket:2438 artegion]:
 > calling Vect_get_line_type with line out of range (i.e. line=0)
 > Vect_line_alive returns -1 but Vect_get_line_type ignores it (not -1 is
 False just like not 1) -> access violation reading ....

 This is a programmer's error. 'Vect_get_line_type()' assumes that the
 programmer first tested if the provided line id is indeed valid. You did
 call 'Vect_line_alive()' first, you can only proceed if the line is alive.
 Fix your code.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2438#comment:1>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list