shadowsocksr-libev: fix use-after-free due to a typo (#193)

This commit is contained in:
MoetaYuko 2024-03-31 19:06:59 +08:00 committed by GitHub
parent 7e408e8f51
commit 445a484de9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);