Print

Print


If the `XrdCl::File::Read()` call fails, `bytesRead` is not initialized. This leads to a segfault when the buffer is passed to Python `PyBytes_FromStringAndSize()`

Valgrind output for xrootd-4.10.0-1.osg34.el7.x86_64:
```
2019-10-03 19:00:56 ==31606== Conditional jump or move depends on uninitialised value(s)
2019-10-03 19:00:56 ==31606==    at 0x4EC9D64: PyString_FromStringAndSize (in /usr/lib64/libpython2.7.so.1.0)
2019-10-03 19:00:56 ==31606==    by 0x117C57B8: PyXRootD::File::Read(PyXRootD::File*, _object*, _object*) (PyXRootDFile.cc:198)
2019-10-03 19:00:56 ==31606==    by 0x4F1BD3F: PyEval_EvalFrameEx (in /usr/lib64/libpython2.7.so.1.0)
```
You can view, comment on, or merge this pull request online at:

  https://github.com/xrootd/xrootd/pull/1063

-- Commit Summary --

  * [Python] Initialize bytesRead in Read() calls

-- File Changes --

    M bindings/python/src/PyXRootDFile.cc (4)

-- Patch Links --

https://github.com/xrootd/xrootd/pull/1063.patch
https://github.com/xrootd/xrootd/pull/1063.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/pull/1063

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1