[Scipy-tickets] [SciPy] #1210: crash during sparse matrix slicing with Python 2.7

SciPy Trac scipy-tickets@scipy....
Thu Jan 27 08:22:41 CST 2011


#1210: crash during sparse matrix slicing with Python 2.7
--------------------------+-------------------------------------------------
 Reporter:  cjgohlke      |       Owner:  wnbell      
     Type:  defect        |      Status:  needs_review
 Priority:  normal        |   Milestone:  0.9.0       
Component:  scipy.sparse  |     Version:  devel       
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by cjgohlke):

 No, {{{*arg11}}} is valid. The crash is during {{{(*(arg11))[0]}}}, the
 indexing of a std::vector of size 0.

 For a std::vector v, v[i] is undefined if i >= v.size(), which is the case
 here. Maybe it is safer to use v.at(i), which should throw an out_of_range
 exception. The length check is needed in any case.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1210#comment:7>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list