Merge branch 'rs/apply-avoid-over-reading'
Code clean-up to fix possible buffer over-reading. * rs/apply-avoid-over-reading: apply: use starts_with() in gitdiff_verify_name()
This commit is contained in:
commit
f9b3252b2a
3
apply.c
3
apply.c
@ -976,8 +976,7 @@ static int gitdiff_verify_name(struct apply_state *state,
|
|||||||
}
|
}
|
||||||
free(another);
|
free(another);
|
||||||
} else {
|
} else {
|
||||||
/* expect "/dev/null" */
|
if (!starts_with(line, "/dev/null\n"))
|
||||||
if (memcmp("/dev/null", line, 9) || line[9] != '\n')
|
|
||||||
return error(_("git apply: bad git-diff - expected /dev/null on line %d"), state->linenr);
|
return error(_("git apply: bad git-diff - expected /dev/null on line %d"), state->linenr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user