git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Range-check array index before access
@ 2025-03-26 17:26 Johannes Schindelin via GitGitGadget
  2025-03-26 17:26 ` [PATCH 1/2] diff: check range before dereferencing an array element Johannes Schindelin via GitGitGadget
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2025-03-26 17:26 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

If we want to check the range of an array index, it makes much more sense to
do it before accessing the corresponding array element, not afterwards.

There are two more instances of this in the clar code, fixes for which I
offer in https://github.com/clar-test/clar/pull/115.

Johannes Schindelin (2):
  diff: check range before dereferencing an array element
  read-cache: check range before dereferencing an array element

 diff.c       | 2 +-
 read-cache.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


base-commit: 683c54c999c301c2cd6f715c411407c413b1d84e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1887%2Fdscho%2Frange-check-array-index-before-access-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1887/dscho/range-check-array-index-before-access-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1887
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-04-29 23:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 17:26 [PATCH 0/2] Range-check array index before access Johannes Schindelin via GitGitGadget
2025-03-26 17:26 ` [PATCH 1/2] diff: check range before dereferencing an array element Johannes Schindelin via GitGitGadget
2025-03-27 11:01   ` Junio C Hamano
2025-03-27 14:59     ` Phillip Wood
2025-03-26 17:26 ` [PATCH 2/2] read-cache: " Johannes Schindelin via GitGitGadget
2025-03-26 18:02   ` Jeff King
2025-03-27 11:05 ` [PATCH v2 0/2] Range-check array index before access Johannes Schindelin via GitGitGadget
2025-03-27 11:05   ` [PATCH v2 1/2] diff: check range before dereferencing an array element Johannes Schindelin via GitGitGadget
2025-03-28  2:54     ` Junio C Hamano
2025-03-27 11:05   ` [PATCH v2 2/2] read-cache: " Johannes Schindelin via GitGitGadget
2025-03-28  5:49     ` Jeff King
2025-04-11 14:50       ` Junio C Hamano
2025-04-29 11:37   ` [PATCH v3] diff: " Johannes Schindelin via GitGitGadget
2025-04-29 19:39     ` Junio C Hamano
2025-04-29 21:58     ` Jeff King
2025-04-29 22:37       ` Junio C Hamano
2025-04-29 23:33         ` Jeff King
2025-04-29 23:46           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).