From a3ccc5af1f393a0ad1ef0a4155e562838fe8b3ad Mon Sep 17 00:00:00 2001
From: Justine Tunney <jtunney@gmail.com>
Date: Thu, 10 Jun 2021 08:55:04 -0700
Subject: [PATCH] Fix redbean hidden path bug

---
 tool/net/redbean.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tool/net/redbean.c b/tool/net/redbean.c
index d8d5aca08..159f58c10 100644
--- a/tool/net/redbean.c
+++ b/tool/net/redbean.c
@@ -680,9 +680,9 @@ static void ProgramPort(long x) {
 
 static void SetDefaults(void) {
 #ifdef STATIC
-  ProgramBrand("redbean-static/1.2");
+  ProgramBrand("redbean-static/1.3");
 #else
-  ProgramBrand("redbean/1.2");
+  ProgramBrand("redbean/1.3");
 #endif
   __log_level = kLogInfo;
   maxpayloadsize = 64 * 1024;
@@ -3259,7 +3259,7 @@ static int LuaHidePath(lua_State *L) {
   size_t pathlen;
   const char *path;
   path = luaL_checklstring(L, 1, &pathlen);
-  AddString(&hidepaths, path, pathlen);
+  AddString(&hidepaths, memcpy(malloc(pathlen), path, pathlen), pathlen);
   return 0;
 }