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

@ -962,7 +962,7 @@ namespace srs_internal
srs_random_generate(random, 1504);
int size = snprintf(random, 1504, "%s", RTMP_SIG_SRS_HANDSHAKE);
srs_assert(size < 1504);
srs_assert(size > 0 && size < 1504);
snprintf(random + 1504 - size, size, "%s", RTMP_SIG_SRS_HANDSHAKE);
srs_random_generate(digest, 32);