Tarsnap / tarsnap

Command-line client code for Tarsnap.
https://tarsnap.com
Other
864 stars 60 forks source link

Elastic array wrap around bug #595

Closed dorjoy03 closed 10 months ago

dorjoy03 commented 10 months ago

Commits picked up from https://github.com/Tarsnap/tarsnap/pull/592.

Two things:

  1. There was a unsigned wrap around bug in the elasticarray resize code which could cause the buffer to become smaller than the given nsize. I don't really know if it could happen in practice or what problems could be caused in case it happens.
  2. Added a comment explaining that another wrap around is actually handled as it was unclear from just the code.
gperciva commented 10 months ago

This is continued in #596, due to github Actions not running on this PR.