]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: avoid string_view to temporary in RGWBulkUploadOp 52159/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 1 Sep 2022 14:50:46 +0000 (10:50 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 22 Jun 2023 15:40:21 +0000 (11:40 -0400)
commitf27d43e14c1b82a26070e11831fea98357b3432c
treecfd435faf5713ad278d5581126859daaa220e507
parent1d771578885cbeb9711a896f8a931fa0d0458284
rgw: avoid string_view to temporary in RGWBulkUploadOp

the `else` block below constructs a temporary std::string that destructs
at the end of the statement, leaving `filename` as a dangling view:
```
filename = file_prefix + std::string(header->get_filename());
```
store a copy of the `std::string` instead

Fixes: https://tracker.ceph.com/issues/57326
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit e9c2ac02f1f59714677e3e1b984367df3c0ec166)
src/rgw/rgw_op.cc