1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Make NAR header check more robust

Changes

  std::bad_alloc

into

  bad archive: input doesn't look like a Nix archive
This commit is contained in:
Eelco Dolstra 2018-09-26 12:03:58 +02:00
parent 7ccdcc7fed
commit 44e86304b6
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 5 additions and 4 deletions

View file

@ -284,7 +284,7 @@ inline uint64_t readLongLong(Source & source)
void readPadding(size_t len, Source & source);
size_t readString(unsigned char * buf, size_t max, Source & source);
string readString(Source & source);
string readString(Source & source, size_t max = std::numeric_limits<size_t>::max());
template<class T> T readStrings(Source & source);
Source & operator >> (Source & in, string & s);