diff --git a/shadowsocksr-libev/patches/104-pointer-used-after-free.patch b/shadowsocksr-libev/patches/104-pointer-used-after-free.patch new file mode 100644 index 000000000..d63c0c602 --- /dev/null +++ b/shadowsocksr-libev/patches/104-pointer-used-after-free.patch @@ -0,0 +1,17 @@ +diff -ur a/server/server.c b/server/server.c +--- a/server/server.c ++++ b/server/server.c +@@ -1942,12 +1942,12 @@ + text = (char*)malloc(strlen(protocol) - 11); + memcpy(text, protocol, strlen(protocol) - 11); + int length = strlen(protocol) - 11; +- free(protocol); + obfs = (char*)malloc(length); + memset(protocol, 0x00, length); + memcpy(protocol, text, length); + LOGI("protocol compatible enable, %s", protocol); + free(text); ++ free(protocol); + protocol_compatible = 1; + } + }