mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
Remove the potential for a division by zero error.
(Closes issue #13810) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1919,7 +1919,7 @@ struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io
|
||||
}
|
||||
|
||||
/* Select a random port number in the range of possible RTP */
|
||||
x = (ast_random() % (rtpend-rtpstart)) + rtpstart;
|
||||
x = (rtpend == rtpstart) ? rtpstart : (ast_random() % (rtpend - rtpstart)) + rtpstart;
|
||||
x = x & ~1;
|
||||
/* Save it for future references. */
|
||||
startplace = x;
|
||||
|
Reference in New Issue
Block a user