containers / storage

Container Storage Library
Apache License 2.0
558 stars 239 forks source link

chunked: fix unmarshaling of file names #1879

Closed giuseppe closed 5 months ago

giuseppe commented 5 months ago

The getString() function was used to extract string values, but it doesn't handle escaped characters. Replace it with iter.ReadString() that is slower but handles escaped characters correctly.

Closes: https://github.com/containers/storage/issues/1878

openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/containers/storage/blob/main/OWNERS)~~ [giuseppe] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
rhatdan commented 5 months ago

LGTM @nalind @mtrmac @saschagrunert @flouthoc PTAL

giuseppe commented 5 months ago
  • (I am ambivalent about the concept of StringsBuf, there is no documented rationale. Is it to save on per-object allocation cost?)

yeah it was done exactly for that reason, but now that we are not using for name is unclear if it is still worth having.

For now, I've simplified the implementation and dropped the StringsBuf performance hack, we can revisit later if needed

mtrmac commented 5 months ago

(Just to be explicit, I’m completely fine with StringsBuf continuing to exist. I have no reason to prefer either way.)

mtrmac commented 5 months ago

/lgtm