Skip to content

Commit c8400d9

Browse files
Hunter, D. Sethgitster
authored andcommitted
http-push: fix xml_entities() string parsing overrun
xml_entities() in http-push.c did not properly stop at the end of the string being examined, which would occasionally cause nonsense to be appended to escaped URL strings and result in failed DAV XML queries Signed-off-by: Seth Hunter <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 606475f commit c8400d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

http-push.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ static char *xml_entities(char *s)
193193
case '&':
194194
strbuf_addstr(&buf, "&amp;");
195195
break;
196+
case 0:
197+
return strbuf_detach(&buf, NULL);
196198
}
197199
s++;
198200
}

0 commit comments

Comments
 (0)