[Scipy-tickets] [SciPy] #657: Weave incorrectly assumes PyStrings are NUL-terminated

SciPy scipy-tickets@scipy....
Fri Apr 25 19:15:44 CDT 2008


#657: Weave incorrectly assumes PyStrings are NUL-terminated
-------------------------+--------------------------------------------------
 Reporter:  jonny5532    |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.7     
Component:  scipy.weave  |     Version:          
 Severity:  normal       |    Keywords:          
-------------------------+--------------------------------------------------
 Weave incorrectly assumes that PyStrings are NUL terminated - they infact
 store the length separately. As a result, all conversions to/from
 std::strings can be unnecessarily truncated if they contain NUL characters
 as they go via char* arrays.

 I have fixed this locally by changing the code surrounding
 PyString_FromString and PyString_AsString calls which convert to/from
 std::strings to also note the length of the string.

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


More information about the Scipy-tickets mailing list