Custom created directory hashes can forge sizes for files, affecting "CumulativeSize" from object stat
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
go-ipfs version: 0.4.10-
Repo version: 5
System version: amd64/linux
Golang version: go1.8.3
Bug: Low Priority
Using dag put it's possible the write a directory object
{"Links":[{"Name":"08-2017.txt","Hash":"QmaLgbbyusb4mmUTYzhoHyapE1HvTYeTrmDkEToC5NGHmc","Size":666666666666666}],"Data":"\u0008\u0001"}
The object size can be any int value
This affects the cumulative size of the object
ipfs object stat QmXrfRCyBoyh5T8nnEA589GcmPgeGQz1mKm5RPaKB6QutT
NumLinks: 1
BlockSize: 64
LinksSize: 62
DataSize: 2
CumulativeSize: 666666666666730
While this isn't critical functionality it's something I personally use frequently for displaying the size of a file.
My alternative is to run object links and tally up the BlockSize to create a total but this requires all the children's content be available.
Contributor guide
Assessment
This issue has not been assessed yet.