104-pointer-used-after-free.patch 570 B

12345678910111213141516
  1. --- a/server/server.c
  2. +++ b/server/server.c
  3. @@ -1942,12 +1942,12 @@
  4. text = (char*)malloc(strlen(protocol) - 11);
  5. memcpy(text, protocol, strlen(protocol) - 11);
  6. int length = strlen(protocol) - 11;
  7. - free(protocol);
  8. obfs = (char*)malloc(length);
  9. memset(protocol, 0x00, length);
  10. memcpy(protocol, text, length);
  11. LOGI("protocol compatible enable, %s", protocol);
  12. free(text);
  13. + free(protocol);
  14. protocol_compatible = 1;
  15. }
  16. }