author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Mon, 24 Oct 2011 06:36:09 +0000 (17:36 +1100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 27 Oct 2011 18:08:26 +0000 (11:08 -0700) | ||
commit | 0de1633783685e9fb1943551217cdda7edbd245b | |
tree | 581476c5e6b352769a391071595e625d7443db24 | tree | snapshot |
parent | 997a1946a55cafb992c4ba8e5e0795aa73f5a4a9 | commit | diff |
tree-walk.c: do not leak internal structure in tree_entry_len()
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)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c | diff | blob | history | |
builtin/pack-objects.c | diff | blob | history | |
tree-diff.c | diff | blob | history | |
tree-walk.c | diff | blob | history | |
tree-walk.h | diff | blob | history | |
tree.c | diff | blob | history | |
unpack-trees.c | diff | blob | history |