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 | |
parent | b5fe65fe93db1931501027a322ecb6a9f17f56e7 (diff) | |
parent | 2d105451c0768fc3e9600dec7bca2376f482521e (diff) | |
download | git-6fee4ca6255ad5ffe3be98c11e7822166e2d4510.tar.gz git-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()
-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") : |