Hi,
This condition is always true because even incorrect offset produces valid (non-NULL) pointer:
data = &payload_text[upload_ctx->bytes_read];
if(data) {
I expect that "if" condition should check the end end of ASCIIZ string:
if(*data) {
Thanks,
Alexander