mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Asan: Fix global ip address leak check bug. v5.0.90 (#3248)
* asan: fix global ips memory leak bug * Asan: Fix global ip address leak check. v5.0.90 * Asan: Directly start SRS for daemon error fixed. Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
9191217e27
commit
f4f9c70d79
6 changed files with 21 additions and 15 deletions
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -63,7 +63,7 @@ jobs:
|
||||||
- name: Run SRS regression-test
|
- name: Run SRS regression-test
|
||||||
run: |
|
run: |
|
||||||
docker run --rm srs:test bash -c 'make && \
|
docker run --rm srs:test bash -c 'make && \
|
||||||
(./objs/srs -c conf/regression-test.conf; ./etc/init.d/srs status) && \
|
./objs/srs -c conf/regression-test.conf && \
|
||||||
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
||||||
outputs:
|
outputs:
|
||||||
SRS_TEST_DONE: ok
|
SRS_TEST_DONE: ok
|
||||||
|
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -204,7 +204,7 @@ jobs:
|
||||||
- name: Run SRS regression-test
|
- name: Run SRS regression-test
|
||||||
run: |
|
run: |
|
||||||
docker run --rm srs:test bash -c 'make && \
|
docker run --rm srs:test bash -c 'make && \
|
||||||
(./objs/srs -c conf/regression-test.conf; ./etc/init.d/srs status) && \
|
./objs/srs -c conf/regression-test.conf && \
|
||||||
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
||||||
outputs:
|
outputs:
|
||||||
SRS_UTEST_DONE: ok
|
SRS_UTEST_DONE: ok
|
||||||
|
|
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 5.0 Changelog
|
## SRS 5.0 Changelog
|
||||||
|
|
||||||
|
* v5.0, 2022-11-21, Asan: Fix global ip address leak check. v5.0.90
|
||||||
* v5.0, 2022-11-20, For [#2532](https://github.com/ossrs/srs/issues/2532): Windows: Support cygwin pipline and packager. v5.0.89
|
* v5.0, 2022-11-20, For [#2532](https://github.com/ossrs/srs/issues/2532): Windows: Support cygwin pipline and packager. v5.0.89
|
||||||
* v5.0, 2022-11-18, Fix [#3215](https://github.com/ossrs/srs/issues/3215): Callback: Fix bug for response string 0. v5.0.88
|
* v5.0, 2022-11-18, Fix [#3215](https://github.com/ossrs/srs/issues/3215): Callback: Fix bug for response string 0. v5.0.88
|
||||||
* v5.0, 2022-11-18, For [#2532](https://github.com/ossrs/srs/issues/2532): Windows: Replace ln by cp for windows. v5.0.87
|
* v5.0, 2022-11-18, For [#2532](https://github.com/ossrs/srs/issues/2532): Windows: Replace ln by cp for windows. v5.0.87
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace tencentcloud_api_sign {
|
||||||
http_request_info[http_request_info.size() - 1] = '\n';
|
http_request_info[http_request_info.size() - 1] = '\n';
|
||||||
}
|
}
|
||||||
//printf("%s\nEOF\n", http_request_info.c_str());
|
//printf("%s\nEOF\n", http_request_info.c_str());
|
||||||
char signed_time[SIGNLEN];
|
char signed_time[SIGNLEN] = {0};
|
||||||
int signed_time_len = snprintf(signed_time, SIGNLEN,
|
int signed_time_len = snprintf(signed_time, SIGNLEN,
|
||||||
"%lu;%lu", time(0) - 60, time(0) + expire);
|
"%lu;%lu", time(0) - 60, time(0) + expire);
|
||||||
//snprintf(signed_time, SIGNLEN, "1510109254;1510109314");
|
//snprintf(signed_time, SIGNLEN, "1510109254;1510109314");
|
||||||
|
@ -148,16 +148,14 @@ namespace tencentcloud_api_sign {
|
||||||
.append(sha1(http_request_info.c_str(), http_request_info.size()))
|
.append(sha1(http_request_info.c_str(), http_request_info.size()))
|
||||||
.append("\n");
|
.append("\n");
|
||||||
//printf("%s\nEOF\n", str_to_sign.c_str());
|
//printf("%s\nEOF\n", str_to_sign.c_str());
|
||||||
char c_signature[SIGNLEN];
|
std::stringstream c_signature;
|
||||||
snprintf(c_signature, SIGNLEN,
|
c_signature << "q-sign-algorithm=sha1&q-ak=" << secret_id.c_str()
|
||||||
"q-sign-algorithm=sha1&q-ak=%s"
|
<< "&q-sign-time=" << signed_time
|
||||||
"&q-sign-time=%s&q-key-time=%s"
|
<< "&q-key-time=" << signed_time
|
||||||
"&q-header-list=%s&q-url-param-list=%s&q-signature=%s",
|
<< "&q-header-list=" << header_list.c_str()
|
||||||
secret_id.c_str(), signed_time, signed_time,
|
<< "&q-url-param-list=" << uri_parm_list.c_str()
|
||||||
header_list.c_str(), uri_parm_list.c_str(),
|
<< "&q-signature=" << hmac_sha1(signkey.c_str(), str_to_sign.c_str(), str_to_sign.size()).c_str();
|
||||||
hmac_sha1(signkey.c_str(), str_to_sign.c_str(),
|
return c_signature.str();
|
||||||
str_to_sign.size()).c_str());
|
|
||||||
return c_signature;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 5
|
#define VERSION_MAJOR 5
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 89
|
#define VERSION_REVISION 90
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -74,6 +74,9 @@ bool _srs_config_by_env = false;
|
||||||
// The binary name of SRS.
|
// The binary name of SRS.
|
||||||
const char* _srs_binary = NULL;
|
const char* _srs_binary = NULL;
|
||||||
|
|
||||||
|
// Free global data, for address sanitizer.
|
||||||
|
extern void srs_free_global_system_ips();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* main entrance.
|
* main entrance.
|
||||||
*/
|
*/
|
||||||
|
@ -222,7 +225,9 @@ srs_error_t do_main(int argc, char** argv, char** envp)
|
||||||
if ((err = run_directly_or_daemon()) != srs_success) {
|
if ((err = run_directly_or_daemon()) != srs_success) {
|
||||||
return srs_error_wrap(err, "run");
|
return srs_error_wrap(err, "run");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srs_free_global_system_ips();
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,6 +452,7 @@ srs_error_t run_directly_or_daemon()
|
||||||
int status = 0;
|
int status = 0;
|
||||||
waitpid(pid, &status, 0);
|
waitpid(pid, &status, 0);
|
||||||
srs_trace("grandpa process exit.");
|
srs_trace("grandpa process exit.");
|
||||||
|
srs_free_global_system_ips();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,6 +465,7 @@ srs_error_t run_directly_or_daemon()
|
||||||
|
|
||||||
if(pid > 0) {
|
if(pid > 0) {
|
||||||
srs_trace("father process exit");
|
srs_trace("father process exit");
|
||||||
|
srs_free_global_system_ips();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue