From: Junio C Hamano Date: Tue, 25 Oct 2011 19:20:21 GMT Subject: Re: [PATCH/WIP 04/11] tree-walk.c: do not leak internal structure in tree_entry_len() Message-ID: <7v8vo85156.fsf@alter.siamese.dyndns.org> In-Reply-To: <1319438176-7304-5-git-send-email-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > tree_entry_len() does not simply take two random arguments and return > a tree length. The two pointers must point to a tree item structure, > or struct name_entry. Passing random pointers will return incorrect > value. > > Force callers to pass struct name_entry instead of two pointers (with > hope that they don't manually construct struct name_entry themselves) Makes quite a lot of sense.