Bug#791641: [PATCH 1/1] url_set_postdata: include terminator in allocation

2015-07-08 Thread Jeff Fulmer
Rob, Sorry, you read it right. This code was recently uploaded and the changes were in the repo: https://github.com/JoeDog/siege Merging your changes with it, the block is shown below. The if-check is gone because it segfaulted if the post data was read from a file that contained a null byte.

Bug#791641: [PATCH 1/1] url_set_postdata: include terminator in allocation

2015-07-07 Thread Rob Browning
Jeff Fulmer writes: > If we do it like that, aren't we whacking the last character of content? Hmm, assuming I'm not misreading, perhaps not? Since for a length of say 1 it'll be "setting this->postdata[1] = 0", and given zero indexing, that'll be assigning 0 to the second character in the arra

Bug#791641: [PATCH 1/1] url_set_postdata: include terminator in allocation

2015-07-07 Thread Jeff Fulmer
Rob, If we do it like that, aren't we whacking the last character of content? What do you think of this: if (strlen(postdata) > 0) { this->postdata = xmalloc(this->postlen + 1); memset(this->postdata, '\0', this->postlen +1); memcpy(this->postdata, postdata, this->postlen);

Bug#791641: [PATCH 1/1] url_set_postdata: include terminator in allocation

2015-07-06 Thread Rob Browning
Package: siege Version: 3.0.8-1 Forwarded: Jeffrey Fulmer Fix a potential segfault in url_set_postdata by including a byte for the null terminator when allocating the result, and switch to xmalloc to catch allocation failures. --- The psuedo-headers above are just for the Debian bug tracker, a