Преглед изворни кода

Merge pull request #1441 from zxlhhyccc/patch-46

shadowsocksr-libev: fix use-after-free due to a typo
coolsnowwolf пре 1 година
родитељ
комит
15ec1d76e5
1 измењених фајлова са 11 додато и 0 уклоњено
  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);