Explorar o código

Merge pull request #1441 from zxlhhyccc/patch-46

shadowsocksr-libev: fix use-after-free due to a typo
coolsnowwolf hai 1 ano
pai
achega
15ec1d76e5
Modificáronse 1 ficheiros con 11 adicións e 0 borrados
  1. 11 0
      shadowsocksr-libev/patches/104-fix-use-after-free.patch

+ 11 - 0
shadowsocksr-libev/patches/104-fix-use-after-free.patch

@@ -0,0 +1,11 @@
+--- a/server/server.c
++++ b/server/server.c
+@@ -1943,7 +1943,7 @@ main(int argc, char **argv)
+             memcpy(text, protocol, strlen(protocol) - 11);
+             int length = strlen(protocol) - 11;
+             free(protocol);
+-            obfs = (char*)malloc(length);
++            protocol = (char*)malloc(length);
+             memset(protocol, 0x00, length);
+             memcpy(protocol, text, length);
+             LOGI("protocol compatible enable, %s", protocol);