mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-23 05:38:41 +00:00
Parse section header ext: don't leak on error
Also free the subsection if we find too many quotes Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
7bc9e2aa2f
commit
7288d8b65c
@ -597,8 +597,10 @@ static int parse_section_header_ext(const char *line, const char *base_name, cha
|
|||||||
do {
|
do {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '"':
|
case '"':
|
||||||
if (quote_marks++ >= 2)
|
if (quote_marks++ >= 2) {
|
||||||
return git__throw(GIT_EOBJCORRUPTED, "Failed to parse ext header. Too many quotes");
|
error = git__throw(GIT_EOBJCORRUPTED, "Failed to parse ext header. Too many quotes");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case '\\':
|
case '\\':
|
||||||
c = line[rpos++];
|
c = line[rpos++];
|
||||||
|
Loading…
Reference in New Issue
Block a user