From 01ed485cf373ffc2424644203ec50e90f019cc6c Mon Sep 17 00:00:00 2001 From: "Hui Zhang (huzhang2)" Date: Mon, 16 Jul 2018 16:27:41 +0800 Subject: [PATCH 1/2] fix #1172 #1173 #1174 #1175 security scan report issue --- trunk/src/app/srs_app_server.cpp | 1 + trunk/src/app/srs_app_utility.cpp | 3 +++ trunk/src/kernel/srs_kernel_codec.cpp | 2 +- trunk/src/kernel/srs_kernel_utility.cpp | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index e56d2042a..9efdba41d 100755 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -690,6 +690,7 @@ int SrsServer::acquire_pid_file() if(errno == EACCES || errno == EAGAIN) { ret = ERROR_SYSTEM_PID_ALREADY_RUNNING; srs_error("srs is already running! ret=%#x", ret); + ::close(fd); return ret; } diff --git a/trunk/src/app/srs_app_utility.cpp b/trunk/src/app/srs_app_utility.cpp index 66107cc6c..d6ac34701 100644 --- a/trunk/src/app/srs_app_utility.cpp +++ b/trunk/src/app/srs_app_utility.cpp @@ -71,6 +71,7 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst if(stfd == NULL){ ret = ERROR_ST_OPEN_SOCKET; srs_error("st_netfd_open_socket failed. ret=%d", ret); + ::close(sock); return ret; } @@ -94,12 +95,14 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst srs_info("connect ok. server=%s, ip=%s, port=%d", server.c_str(), ip.c_str(), port); *pstfd = stfd; + ::close(sock); return ret; failed: if (stfd) { srs_close_stfd(stfd); } + ::close(sock); return ret; } diff --git a/trunk/src/kernel/srs_kernel_codec.cpp b/trunk/src/kernel/srs_kernel_codec.cpp index 42d577204..75001d241 100644 --- a/trunk/src/kernel/srs_kernel_codec.cpp +++ b/trunk/src/kernel/srs_kernel_codec.cpp @@ -169,7 +169,7 @@ string srs_codec_avc_level2str(SrsAvcLevel level) // 1 = 11 kHz = 11025 Hz // 2 = 22 kHz = 22050 Hz // 3 = 44 kHz = 44100 Hz -int flv_sample_rates[] = {5512, 11025, 22050, 44100}; +int flv_sample_rates[] = {5512, 11025, 22050, 44100, 0}; // the sample rates in the codec, // in the sequence header. diff --git a/trunk/src/kernel/srs_kernel_utility.cpp b/trunk/src/kernel/srs_kernel_utility.cpp index 276c32123..60eef5ddb 100644 --- a/trunk/src/kernel/srs_kernel_utility.cpp +++ b/trunk/src/kernel/srs_kernel_utility.cpp @@ -652,7 +652,7 @@ int srs_av_base64_decode(u_int8_t* out, const char* in_str, int out_size) // no sign extension const u_int8_t *in = (const u_int8_t*)in_str; unsigned bits = 0xff; - unsigned v; + unsigned v = 0; while (end - dst > 3) { BASE64_DEC_STEP(0); From 2d49b9d1a734a348f9f646ab4bf69831740bf69c Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 17 Jul 2018 13:44:01 +0800 Subject: [PATCH 2/2] Merge #1176, fix scaned issues. 2.0.248 --- README.md | 2 ++ trunk/src/core/srs_core.hpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e5d78fbf..99599ae13 100755 --- a/README.md +++ b/README.md @@ -332,6 +332,7 @@ Remark: ## History +* v2.0, 2018-07-17, Merge [#1176][bug #1176], fix scaned issues. 2.0.248 * v2.0, 2018-02-28, Merge [#1077][bug #1077], fix crash for edge HLS. 2.0.247 * v2.0, 2018-02-13, Fix [#1059][bug #1059], support vhost in stream parameters. 2.0.246 * v2.0, 2018-01-07, Merge [#1045][bug #1045], fix [#1044][bug #1044], TCP connection alive detection. 2.0.245 @@ -1307,6 +1308,7 @@ Winlin [bug #1045]: https://github.com/ossrs/srs/issues/1045 [bug #1059]: https://github.com/ossrs/srs/issues/1059 [bug #1077]: https://github.com/ossrs/srs/issues/1077 +[bug #1176]: https://github.com/ossrs/srs/issues/1176 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index cd0ab889a..ad068719a 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 247 +#define VERSION_REVISION 248 // generated by configure, only macros. #include