diff src/c/driver.c @ 400:e756d3a47726

Fix a nasty driver bug, involving memory restarts and marked-up request strings
author Adam Chlipala <adamc@hcoop.net>
date Tue, 21 Oct 2008 13:54:48 -0400
parents b91480c9a729
children cc71fb7e5e54
line wrap: on
line diff
--- a/src/c/driver.c	Tue Oct 21 13:41:03 2008 -0400
+++ b/src/c/driver.c	Tue Oct 21 13:54:48 2008 -0400
@@ -116,7 +116,7 @@
       *back = 0;
     
       if (s = strstr(buf, "\r\n\r\n")) {
-        char *cmd, *path, *inputs;
+        char *cmd, *path, path_copy[uw_bufsize+1], *inputs;
 
         *s = 0;
 
@@ -175,7 +175,8 @@
           uw_write(ctx, "Content-type: text/html\r\n\r\n");
           uw_write(ctx, "<html>");
 
-          fk = uw_begin(ctx, path);
+          strcpy(path_copy, path);
+          fk = uw_begin(ctx, path_copy);
           if (fk == SUCCESS) {
             uw_write(ctx, "</html>");
             break;