Based on the suggestions by @kinnison I have changed these.
Fix an unused return value in buffer.c as well, while our other branch probably needs a merge now
Change the scope of the variables, and initialise the item.
Just an extra safe-guard to check for NULL
Initialise xsendfile_len with 0;
Initialise len = 0;