mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Coverity Report: Fix issues for error type REVERSE_INULL (deprecated modules)
* Fix only issue pointed out by deprecated_REVERSE_INULL.txt for app_meetme.c in find_user(). * Change use of %i to %d in sscanf() in find_user(). The use of %i gives unexpected parsing because it can accept hex, octal, and decimal integer formats. * Changed other uses of %i in app_meetme() to use %d for consistency. (issue ASTERISK-19648) Reported by: Matt Jordan ........ Merged revisions 367906 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 367907 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2180,12 +2180,12 @@ static int can_write(struct ast_channel *chan, struct ast_flags64 *confflags)
|
|||||||
static void send_talking_event(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking)
|
static void send_talking_event(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking)
|
||||||
{
|
{
|
||||||
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalking",
|
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalking",
|
||||||
"Channel: %s\r\n"
|
"Channel: %s\r\n"
|
||||||
"Uniqueid: %s\r\n"
|
"Uniqueid: %s\r\n"
|
||||||
"Meetme: %s\r\n"
|
"Meetme: %s\r\n"
|
||||||
"Usernum: %d\r\n"
|
"Usernum: %d\r\n"
|
||||||
"Status: %s\r\n",
|
"Status: %s\r\n",
|
||||||
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no, talking ? "on" : "off");
|
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no, talking ? "on" : "off");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_user_talking(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
|
static void set_user_talking(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
|
||||||
@@ -3144,12 +3144,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
|
|||||||
}
|
}
|
||||||
|
|
||||||
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
|
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
|
||||||
"Channel: %s\r\n"
|
"Channel: %s\r\n"
|
||||||
"Uniqueid: %s\r\n"
|
"Uniqueid: %s\r\n"
|
||||||
"Meetme: %s\r\n"
|
"Meetme: %s\r\n"
|
||||||
"Usernum: %i\r\n"
|
"Usernum: %d\r\n"
|
||||||
"Status: on\r\n",
|
"Status: on\r\n",
|
||||||
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If I should be un-muted but am not talker, un-mute me */
|
/* If I should be un-muted but am not talker, un-mute me */
|
||||||
@@ -3162,12 +3162,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
|
|||||||
}
|
}
|
||||||
|
|
||||||
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
|
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
|
||||||
"Channel: %s\r\n"
|
"Channel: %s\r\n"
|
||||||
"Uniqueid: %s\r\n"
|
"Uniqueid: %s\r\n"
|
||||||
"Meetme: %s\r\n"
|
"Meetme: %s\r\n"
|
||||||
"Usernum: %i\r\n"
|
"Usernum: %d\r\n"
|
||||||
"Status: off\r\n",
|
"Status: off\r\n",
|
||||||
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) &&
|
if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) &&
|
||||||
@@ -3175,12 +3175,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
|
|||||||
talkreq_manager = 1;
|
talkreq_manager = 1;
|
||||||
|
|
||||||
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
|
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
|
||||||
"Channel: %s\r\n"
|
"Channel: %s\r\n"
|
||||||
"Uniqueid: %s\r\n"
|
"Uniqueid: %s\r\n"
|
||||||
"Meetme: %s\r\n"
|
"Meetme: %s\r\n"
|
||||||
"Usernum: %i\r\n"
|
"Usernum: %d\r\n"
|
||||||
"Status: on\r\n",
|
"Status: on\r\n",
|
||||||
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3188,12 +3188,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
|
|||||||
!(user->adminflags & ADMINFLAG_T_REQUEST) && (talkreq_manager)) {
|
!(user->adminflags & ADMINFLAG_T_REQUEST) && (talkreq_manager)) {
|
||||||
talkreq_manager = 0;
|
talkreq_manager = 0;
|
||||||
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
|
ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
|
||||||
"Channel: %s\r\n"
|
"Channel: %s\r\n"
|
||||||
"Uniqueid: %s\r\n"
|
"Uniqueid: %s\r\n"
|
||||||
"Meetme: %s\r\n"
|
"Meetme: %s\r\n"
|
||||||
"Usernum: %i\r\n"
|
"Usernum: %d\r\n"
|
||||||
"Status: off\r\n",
|
"Status: off\r\n",
|
||||||
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If user have been hung up, exit the conference */
|
/* If user have been hung up, exit the conference */
|
||||||
@@ -4579,8 +4579,7 @@ static struct ast_conf_user *find_user(struct ast_conference *conf, const char *
|
|||||||
struct ast_conf_user *user = NULL;
|
struct ast_conf_user *user = NULL;
|
||||||
int cid;
|
int cid;
|
||||||
|
|
||||||
sscanf(callerident, "%30i", &cid);
|
if (conf && callerident && sscanf(callerident, "%30d", &cid) == 1) {
|
||||||
if (conf && callerident) {
|
|
||||||
user = ao2_find(conf->usercontainer, &cid, 0);
|
user = ao2_find(conf->usercontainer, &cid, 0);
|
||||||
/* reference decremented later in admin_exec */
|
/* reference decremented later in admin_exec */
|
||||||
return user;
|
return user;
|
||||||
|
Reference in New Issue
Block a user