Thread: RE:BUG #18533: pg_basebackup uses out-of-bounds memory and a segment error occurs during backup


> Do I think we should remove the bbstreamer_buffer_until call in the
> bbstreamer_tar_parser_content function in the scenario of
> BBFLOWER_MEMBER_TRAILER?

It might be more semantically appropriate to change the data in the bbstreamer_content function call to streamer->bbs_buffer

case BBSTREAMER_MEMBER_TRAILER:
if (!bbstreamer_buffer_until(streamer, &data, &len,
mystreamer->pad_bytes_expected))
return;

/* OK, now we can send it. */
bbstreamer_content(mystreamer->base.bbs_next,
   &mystreamer->member,
   data, mystreamer->pad_bytes_expected,
   BBSTREAMER_MEMBER_TRAILER);