Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2013-08-07 20:11:55 +0400
committerEdward Thomson <ethomson@microsoft.com>2013-08-07 21:38:09 +0400
commit2d9f5b9f13107a4f59ea1c055620efeb603f2bab (patch)
tree533772f695abb6728bba54c7ddf08239e4d23a29 /src/config_file.c
parentc5780abb024a3d570bc1e7eb8c892a60b77bad84 (diff)
Parse config headers with quoted quotes
Parse config headers that have the last quote on the line quoted instead of walking off the end.
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 2b0732a13..570f286c8 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -792,6 +792,11 @@ static int parse_section_header_ext(diskfile_backend *cfg, const char *line, con
}
switch (c) {
+ case 0:
+ set_parse_error(cfg, 0, "Unexpected end-of-line in section header");
+ git_buf_free(&buf);
+ return -1;
+
case '"':
++quote_marks;
continue;
@@ -801,6 +806,12 @@ static int parse_section_header_ext(diskfile_backend *cfg, const char *line, con
switch (c) {
case '"':
+ if (&line[rpos-1] == last_quote) {
+ set_parse_error(cfg, 0, "Missing closing quotation mark in section header");
+ git_buf_free(&buf);
+ return -1;
+ }
+
case '\\':
break;