Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rev-parse: check i before using argv[i] against argc
The --prefix, --default, and --resolve-git-dir options to git-rev-parse require an argument, but when given no argument, the code uses the NULL read from argv[argc] without checking, leading to a segfault. Instead, check first and die() with an error message. Signed-off-by: David Sharp <dhsharp@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information