fix invalid read problem

This commit is contained in:
Xuan Sang LE
2018-03-17 15:49:37 +01:00
parent 88a85fb36a
commit 64b27c0dd3
2 changed files with 6 additions and 2 deletions

View File

@ -249,6 +249,8 @@ int regex_match(const char* expr,const char* search, int msize, regmatch_t* matc
return ret;
}
char *url_decode(const char *str) {
if(!str)
return NULL;
char *pstr = str, *buf = malloc(strlen(str) + 1), *pbuf = buf;
while (*pstr) {