mirror of
https://github.com/kenzok8/small-package
synced 2025-01-09 04:37:59 +08:00
Update 104-pointer-used-after-free.patch
This commit is contained in:
parent
93e91dab66
commit
70d02c24cd
@ -2,30 +2,16 @@ 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;
|
||||
}
|
||||
}
|
||||
@@ -1964,12 +1964,12 @@
|
||||
text = (char*)malloc(strlen(obfs) - 11);
|
||||
memcpy(text, obfs, strlen(obfs) - 11);
|
||||
int length = strlen(obfs) - 11;
|
||||
- free(obfs);
|
||||
obfs = (char*)malloc(length);
|
||||
memset(obfs, 0x00, length);
|
||||
memcpy(obfs, text, length);
|
||||
LOGI("obfs compatible enable, %s", obfs);
|
||||
free(text);
|
||||
+ free(obfs);
|
||||
obfs_compatible = 1;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user