Print

Print


At the risk of being a little annoying, Chris Jones and I bumped into a 
few more bugs/nits.

src/XrdXr/XrdXrClient.cc : 54

XrdXrClient::XrdXrClient takes over the pointer to hostname instead of 
copying the string.
This is risky since the caller may have the string in a transient 
object. At the very least there should be a warning comment to the 
effect that it better not be transient...

src/XrdXr/XrdXrClient.cc : 217

fileInfo.path = (kXR_char*) malloc(strlen((char*) path));
strncpy((char*) fileInfo.path, (char*) path, strlen((char*) path));

The string copy does not copy the null byte at the end of the string. 
We believe we found code that depends on null-termination of this 
string.  It might be better to use a C++ string, but that doesn't fit 
the rest of the code.  Continuing in the C-style, this code would be 
better as

fileInfo.path = (kXr_char *) strdup((const char *)path);

src/XrdXr/XrdXrClient.cc : 418
same string duplication error - use strdup, or use the C++ string class.

src/XrdOuc/XrdOucPthread.cc
I missed this one yesterday. Sorry.
in XrdOucThread_Sys the last 2 lines can be replaced by return 
pthread_create(...

--
Gregory J. Sharp                   email: [log in to unmask]
Wilson Synchrotron Laboratory      url: 
http://www.lepp.cornell.edu/~gregor
Dryden Rd                          ph:  +1 607 255 4882
Ithaca, NY 14853                   fax: +1 607 255 8062