Skip to content
  • Jeff King's avatar
    v0 protocol: use size_t for capability length/offset · 7ce4c8f7
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When parsing server capabilities, we use "int" to store lengths and
    offsets. At first glance this seems like a spot where our parser may be
    confused by integer overflow if somebody sent us a malicious response.
    
    In practice these strings are all bounded by the 64k limit of a
    pkt-line, so using "int" is OK. However, it makes the code simpler to
    audit if they just use size_t everywhere. Note that because we take
    these parameters as pointers, this also forces many callers to update
    their declared types.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    7ce4c8f7