Re: [RFC/PATCHv10 01/11] fast-import: Proper notes tree manipulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johan Herland <johan@xxxxxxxxxxx> wrote:
> +static unsigned char convert_num_notes_to_fanout(uintmax_t num_notes)
> +{
> +	unsigned char fanout = 0;
> +	while ((num_notes >>= 8))
> +		fanout++;
> +	return fanout;
> +}
> +
> +static void construct_path_with_fanout(const char *hex_sha1,
> +		unsigned char fanout, char *path)
> +{
> +	unsigned int i = 0, j = 0;
> +	if (fanout >= 20)
> +		die("Too large fanout (%u)", fanout);

Shouldn't convert_num_notes_to_fanout have a guard to prevent this
case from happening?

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]