104-fix-use-after-free.patch 793 B

1234567891011121314151617181920
  1. From 445a484de9c9bf801572d970f45ad0e11a18e35d Mon Sep 17 00:00:00 2001
  2. From: MoetaYuko <[email protected]>
  3. Date: Sun, 31 Mar 2024 19:06:59 +0800
  4. Subject: [PATCH] shadowsocksr-libev: fix use-after-free due to a typo (#193)
  5. ---
  6. shadowsocksr-libev/src/server/server.c | 2 +-
  7. 1 file changed, 1 insertion(+), 1 deletion(-)
  8. --- a/server/server.c
  9. +++ b/server/server.c
  10. @@ -1943,7 +1943,7 @@ main(int argc, char **argv)
  11. memcpy(text, protocol, strlen(protocol) - 11);
  12. int length = strlen(protocol) - 11;
  13. free(protocol);
  14. - obfs = (char*)malloc(length);
  15. + protocol = (char*)malloc(length);
  16. memset(protocol, 0x00, length);
  17. memcpy(protocol, text, length);
  18. LOGI("protocol compatible enable, %s", protocol);