sha1_file: guard against invalid loose subdirectory numbers
Loose object subdirectories have hexadecimal names based on the first byte of the hash of contained objects, thus their numerical representation can range from 0 (0x00) to 255 (0xff). Change the type of the corresponding variable in for_each_file_in_obj_subdir() and associated callback functions to unsigned int and add a range check. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0375f472d4
commit
70c49050d4
@ -10,7 +10,7 @@ static const char * const prune_packed_usage[] = {
|
||||
|
||||
static struct progress *progress;
|
||||
|
||||
static int prune_subdir(int nr, const char *path, void *data)
|
||||
static int prune_subdir(unsigned int nr, const char *path, void *data)
|
||||
{
|
||||
int *opts = data;
|
||||
display_progress(progress, nr + 1);
|
||||
|
Reference in New Issue
Block a user