mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
Bug 6873 - Finish moving from the non-threadsafe (and poor randomness) rand() to threadsafe ast_random()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1674,7 +1674,7 @@ static int process_message(struct mansession *s, struct message *m)
|
||||
authtype = astman_get_header(m, "AuthType");
|
||||
if (!strcasecmp(authtype, "MD5")) {
|
||||
if (ast_strlen_zero(s->challenge))
|
||||
snprintf(s->challenge, sizeof(s->challenge), "%d", rand());
|
||||
snprintf(s->challenge, sizeof(s->challenge), "%ld", ast_random());
|
||||
ast_mutex_lock(&s->__lock);
|
||||
astman_append(s, "Response: Success\r\n"
|
||||
"%s"
|
||||
|
||||
Reference in New Issue
Block a user