Skip to content

Commit

Permalink
Merge pull request #1176 from fastfading/2.0release
Browse files Browse the repository at this point in the history
fix security scan report issue #1172 #1173 #1174 #1175
  • Loading branch information
winlinvip authored Jul 17, 2018
2 parents 0fe17c3 + 01ed485 commit dc6b329
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions trunk/src/app/srs_app_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/src/app/srs_app_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/src/kernel/srs_kernel_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/kernel/srs_kernel_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dc6b329

Please sign in to comment.