threads / patch / 19989

patchhttp-push: fix xml_entities() string parsing overrun

Subject: [PATCH] http-push: fix xml_entities() string parsing overrun

## tl;dr

One message between Jul 1, 2009 and Jul 1, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Hunter, D. Seth· Jul 1, 2009, 00:24 UTC · lore
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>
---
 http-push.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Show changes to http-push.c +2 −0
diff --git a/http-push.c b/http-push.c
index 8cc8ee0..00e83dc 100644
--- a/http-push.c
+++ b/http-push.c
@@ -193,6 +193,8 @@ static char *xml_entities(char *s)
 		case '&':
 			strbuf_addstr(&buf, "&amp;");
 			break;
+		case 0:
+			return strbuf_detach(&buf, NULL);
 		}
 		s++;
 	}
-- 
1.6.3.3

← back to recent threads