[asterisk-commits] rmudgett: branch 10 r367907 - in /branches/10: ./ apps/app_meetme.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 29 17:28:59 CDT 2012


Author: rmudgett
Date: Tue May 29 17:28:55 2012
New Revision: 367907

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=367907
Log:
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

Modified:
    branches/10/   (props changed)
    branches/10/apps/app_meetme.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_meetme.c?view=diff&rev=367907&r1=367906&r2=367907
==============================================================================
--- branches/10/apps/app_meetme.c (original)
+++ branches/10/apps/app_meetme.c Tue May 29 17:28:55 2012
@@ -2173,12 +2173,12 @@
 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",
-	      "Channel: %s\r\n"
-	      "Uniqueid: %s\r\n"
-	      "Meetme: %s\r\n"
-	      "Usernum: %d\r\n"
-	      "Status: %s\r\n",
-	      chan->name, chan->uniqueid, conf->confno, user->user_no, talking ? "on" : "off");
+		"Channel: %s\r\n"
+		"Uniqueid: %s\r\n"
+		"Meetme: %s\r\n"
+		"Usernum: %d\r\n"
+		"Status: %s\r\n",
+		chan->name, chan->uniqueid, 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)
@@ -3127,12 +3127,12 @@
 				}
 
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
-						"Channel: %s\r\n"
-						"Uniqueid: %s\r\n"
-						"Meetme: %s\r\n"
-						"Usernum: %i\r\n"
-						"Status: on\r\n",
-						chan->name, chan->uniqueid, conf->confno, user->user_no);
+					"Channel: %s\r\n"
+					"Uniqueid: %s\r\n"
+					"Meetme: %s\r\n"
+					"Usernum: %d\r\n"
+					"Status: on\r\n",
+					chan->name, chan->uniqueid, conf->confno, user->user_no);
 			}
 
 			/* If I should be un-muted but am not talker, un-mute me */
@@ -3145,12 +3145,12 @@
 				}
 
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
-						"Channel: %s\r\n"
-						"Uniqueid: %s\r\n"
-						"Meetme: %s\r\n"
-						"Usernum: %i\r\n"
-						"Status: off\r\n",
-						chan->name, chan->uniqueid, conf->confno, user->user_no);
+					"Channel: %s\r\n"
+					"Uniqueid: %s\r\n"
+					"Meetme: %s\r\n"
+					"Usernum: %d\r\n"
+					"Status: off\r\n",
+					chan->name, chan->uniqueid, conf->confno, user->user_no);
 			}
 			
 			if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && 
@@ -3158,12 +3158,12 @@
 				talkreq_manager = 1;
 
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
-					      "Channel: %s\r\n"
-							      "Uniqueid: %s\r\n"
-							      "Meetme: %s\r\n"
-							      "Usernum: %i\r\n"
-							      "Status: on\r\n",
-							      chan->name, chan->uniqueid, conf->confno, user->user_no);
+					"Channel: %s\r\n"
+					"Uniqueid: %s\r\n"
+					"Meetme: %s\r\n"
+					"Usernum: %d\r\n"
+					"Status: on\r\n",
+					chan->name, chan->uniqueid, conf->confno, user->user_no);
 			}
 
 			
@@ -3171,12 +3171,12 @@
 				!(user->adminflags & ADMINFLAG_T_REQUEST) && (talkreq_manager)) {
 				talkreq_manager = 0;
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
-					      "Channel: %s\r\n"
-							      "Uniqueid: %s\r\n"
-							      "Meetme: %s\r\n"
-							      "Usernum: %i\r\n"
-							      "Status: off\r\n",
-							     chan->name, chan->uniqueid, conf->confno, user->user_no);
+					"Channel: %s\r\n"
+					"Uniqueid: %s\r\n"
+					"Meetme: %s\r\n"
+					"Usernum: %d\r\n"
+					"Status: off\r\n",
+					chan->name, chan->uniqueid, conf->confno, user->user_no);
 			}
 			
 			/* If I have been kicked, exit the conference */
@@ -4550,9 +4550,8 @@
 {
 	struct ast_conf_user *user = NULL;
 	int cid;
-	
-	sscanf(callerident, "%30i", &cid);
-	if (conf && callerident) {
+
+	if (conf && callerident && sscanf(callerident, "%30d", &cid) == 1) {
 		user = ao2_find(conf->usercontainer, &cid, 0);
 		/* reference decremented later in admin_exec */
 		return user;




More information about the asterisk-commits mailing list