1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Fix the snprintf size issue.

This commit is contained in:
winlin 2022-08-10 08:32:02 +08:00
parent 1ab584b2ae
commit a71eddd56a
10 changed files with 46 additions and 17 deletions

View file

@ -170,7 +170,8 @@ srs_error_t srs_srt_listen(srs_srt_t srt_fd, std::string ip, int port)
srs_error_t err = srs_success;
char sport[8];
snprintf(sport, sizeof(sport), "%d", port);
int r0 = snprintf(sport, sizeof(sport), "%d", port);
srs_assert(r0 > 0 && r0 < sizeof(sport));
addrinfo hints;
memset(&hints, 0, sizeof(hints));