Re: [PATCH 21/41] http: eliminate hard-coded constants

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

 



On Wed, Apr 25, 2018 at 08:44:19AM +0900, Junio C Hamano wrote:
> Martin Ågren <martin.agren@xxxxxxxxx> writes:
> 
> >>                 switch (data[i]) {
> >>                 case 'P':
> >>                         i++;
> >> -                       if (i + 52 <= buf.len &&
> >> +                       if (i + hexsz + 12 <= buf.len &&
> >>                             starts_with(data + i, " pack-") &&
> >> -                           starts_with(data + i + 46, ".pack\n")) {
> >> -                               get_sha1_hex(data + i + 6, sha1);
> >> -                               fetch_and_setup_pack_index(packs_head, sha1,
> >> +                           starts_with(data + i + hexsz + 6, ".pack\n")) {
> >> +                               get_sha1_hex(data + i + 6, hash);
> >> +                               fetch_and_setup_pack_index(packs_head, hash,
> >>                                                       base_url);
> >>                                 i += 51;
> >
> > s/51/hexsz + 11/ ?
> 
> Quite right.

Good point.  Will fix.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature


[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]

  Powered by Linux