Calling memcpy() with a size argument of zero is a noop on Linux,
so this should be OK. However, memcpy(3) does not say anything about
this case, so let's be conservative here and call it only if there is
anything to copy.
query.size = arg_obj->size + stdin_obj.size;
query.data = para_malloc(query.size);
memcpy(query.data, arg_obj->data, arg_obj->size);
- memcpy((char *)query.data + arg_obj->size, stdin_obj.data, stdin_obj.size);
+ if (stdin_obj.size > 0)
+ memcpy((char *)query.data + arg_obj->size, stdin_obj.data,
+ stdin_obj.size);
free(stdin_obj.data);
ret = send_callback_request(f, &query, result_handler, private_result_data);
free(query.data);