diff options
| author | Patrick Steinhardt <ps@pks.im> | 2019-07-20 18:49:48 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2019-07-20 18:49:48 +0200 |
| commit | a613832ef35b2901896211c4c4eaeb31ed2b3cbc (patch) | |
| tree | 4c0cc856971dda43c4c4e71fa7107b464c8e139f /tests/diff | |
| parent | e07dbc92d113fbddd2a042b45ef1a01347492a4c (diff) | |
| download | libgit2-a613832ef35b2901896211c4c4eaeb31ed2b3cbc.tar.gz | |
patch_parse: fix segfault due to line containing static contents
With commit dedf70ad2 (patch_parse: do not depend on parsed buffer's
lifetime, 2019-07-05), all lines of the patch are allocated with
`strdup` to make lifetime of the parsed patch independent of the buffer
that is currently being parsed. In patch b08932824 (patch_parse: ensure
valid patch output with EOFNL, 2019-07-11), we introduced another
code location where we add lines to the parsed patch. But as that one
was implemented via a separate pull request, it wasn't converted to use
`strdup`, as well. As a consequence, we generate a segfault when trying
to deallocate the potentially static buffer that's now in some of the
lines.
Use `git__strdup` to fix the issue.
Diffstat (limited to 'tests/diff')
0 files changed, 0 insertions, 0 deletions
