Created
May 11, 2012 01:33
-
-
Save ConradIrwin/2656940 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include "libxml/tree.h" | |
int main(){ | |
char buf[4000000]; | |
const char *line = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
\n"; | |
const char *xml = "<foo></foo>"; | |
int i; | |
// 4MB of 80-byte lines with an entity at the end. | |
for (i = 0; i < 50000; i++) { | |
memcpy(&buf[i * 80], line, 80); | |
} | |
buf[4000000] = '\0'; | |
xmlDocPtr doc = xmlReadMemory(xml, strlen(xml), NULL, NULL, 0); | |
xmlNodeSetContent(doc->children, buf); | |
xmlFreeDoc(doc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment