Impose maximum sizes on parsed objects
commit373a1bc40e88d90e75f4a70b7d2018fe7288035a
authorNick Mathewson <nickm@torproject.org>
Mon, 10 Jan 2011 17:12:11 +0000 (10 12:12 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 10 Jan 2011 17:12:11 +0000 (10 12:12 -0500)
tree4a95e8ab3eb5bc7b94d7681dfd6166ea2bb0ac96
parent729f404efec0795f7ed358e7b2fa08bd62cc1ae8
Impose maximum sizes on parsed objects

An object, you'll recall, is something between -----BEGIN----- and
-----END----- tags in a directory document.  Some of our code, as
doorss has noted in bug 2352, could assert if one of these ever
overflowed SIZE_T_CEILING but not INT_MAX.  As a solution, I'm setting
a maximum size on a single object such that neither of these limits
will ever be hit.  I'm also fixing the INT_MAX checks, just to be sure.
changes/bug2352 [new file with mode: 0644]
src/or/routerparse.c