Commit 9c0120ae authored by Bernhard Link's avatar Bernhard Link

more strict checking of all size information in .changes files

parent e384d752
2013-10-05 Bernhard R. Link <brlink@debian.org>
* fix docs/outstore.py to work with newer python3 dbm behaviour
* more strict checking of all size information in .changes files
2013-06-15 Bernhard R. Link <brlink@debian.org>
* use libarchive_read_free instead of libarchive_read_finish
......
......@@ -621,9 +621,25 @@ static retvalue parse_changes_files(struct changes *c, struct strlist filelines[
}
hashes[ofs].hashes[cs].start = hashstart;
hashes[ofs].hashes[cs].len = hashend - hashstart;
// TODO: compare instead:
// hashes[ofs].hashes[cs_length].start = sizestart;
// hashes[ofs].hashes[cs_length].len = sizeend - sizestart;
size_t sizelen = sizeend - sizestart;
if (hashes[ofs].hashes[cs_length].start == NULL) {
hashes[ofs].hashes[cs_length].start = sizestart;
hashes[ofs].hashes[cs_length].len = sizelen;
} else if (hashes[ofs].hashes[cs_length].len != sizelen
|| memcmp(sizestart,
hashes[ofs].hashes[cs_length].start,
sizelen) != 0) {
fprintf(stderr,
"Error: Contradicting file size information for '%s' ('%.*s' vs '%.*s') in .changes file\n",
f->basename,
(int)sizelen, sizestart,
(int)hashes[ofs].hashes[cs_length].len,
hashes[ofs].hashes[cs_length].start);
return RET_ERROR;
}
}
}
ofs = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment