Re: [EGIT PATCH 08/10] Drop unused end parameters in hunk parsing code

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

 



Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> wrote:
> Is this safe, or should they actually be used?

Yea, these are safe to remove.  At worst we move one line beyond
the end marker given to us by the user in Patch.parse() and then
abort the parse loop when we find ptr >= end.  We should also never
exceed the byte[] length; the ParseUtils methods we use do their
own array bound checks internally.

>  .../org/spearce/jgit/patch/CombinedHunkHeader.java |    2 +-
>  .../src/org/spearce/jgit/patch/HunkHeader.java     |    2 +-
>  .../src/org/spearce/jgit/patch/Patch.java          |    8 ++++----
>  3 files changed, 6 insertions(+), 6 deletions(-)

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

  Powered by Linux