diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-07-12 15:18:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-12 15:18:22 -0700 |
commit | 6fee4ca6255ad5ffe3be98c11e7822166e2d4510 (patch) | |
tree | b475b7357d298162185c1fc213c4773d8ad6ff1f /apply.c | |
parent | Merge branch 'sb/submodule-doc' (diff) | |
parent | apply: use strcmp(3) for comparing strings in gitdiff_verify_name() (diff) | |
download | tgif-6fee4ca6255ad5ffe3be98c11e7822166e2d4510.tar.xz |
Merge branch 'rs/apply-avoid-over-reading'
Code cleanup.
* rs/apply-avoid-over-reading:
apply: use strcmp(3) for comparing strings in gitdiff_verify_name()
Diffstat (limited to 'apply.c')
-rw-r--r-- | apply.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -962,13 +962,12 @@ static int gitdiff_verify_name(struct apply_state *state, } if (*name) { - int len = strlen(*name); char *another; if (isnull) return error(_("git apply: bad git-diff - expected /dev/null, got %s on line %d"), *name, state->linenr); another = find_name(state, line, NULL, state->p_value, TERM_TAB); - if (!another || memcmp(another, *name, len + 1)) { + if (!another || strcmp(another, *name)) { free(another); return error((side == DIFF_NEW_NAME) ? _("git apply: bad git-diff - inconsistent new filename on line %d") : |