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 <hunter@ll.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Hunter, D. Seth 2009-06-30 20:24:47 -04:00 committed by Junio C Hamano
parent 606475f317
commit c8400d9ef5

View File

@ -193,6 +193,8 @@ static char *xml_entities(char *s)
case '&': case '&':
strbuf_addstr(&buf, "&amp;"); strbuf_addstr(&buf, "&amp;");
break; break;
case 0:
return strbuf_detach(&buf, NULL);
} }
s++; s++;
} }