Merge "main/sdp_srtp.c: allow SDP crypto tag to be up to 9 digits"
authorJoshua Colp <jcolp@digium.com>
Thu, 21 May 2015 10:15:41 +0000 (05:15 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Thu, 21 May 2015 10:15:41 +0000 (05:15 -0500)
main/sdp_srtp.c

index 4ec9f81..e576258 100644 (file)
@@ -238,7 +238,8 @@ int ast_sdp_crypto_process(struct ast_rtp_instance *rtp, struct ast_sdp_srtp *sr
                return -1;
        }
 
-       if (sscanf(tag, "%30d", &crypto->tag) != 1 || crypto->tag <= 0 || crypto->tag > 9) {
+       /* RFC4568 9.1 - tag is 1-9 digits, greater than zero */
+       if (sscanf(tag, "%30d", &crypto->tag) != 1 || crypto->tag <= 0 || crypto->tag > 999999999) {
                ast_log(LOG_WARNING, "Unacceptable a=crypto tag: %s\n", tag);
                return -1;
        }