Files
Archive/small/shadowsocksr-libev/patches/104-fix-use-after-free.patch
2024-03-26 19:28:40 +01:00

16 lines
591 B
Diff

--- a/server/server.c
+++ b/server/server.c
@@ -1942,11 +1942,11 @@ main(int argc, char **argv)
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(protocol);
free(text);
protocol_compatible = 1;
}