diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-03 13:08:48 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-03 13:08:48 +0000 |
commit | b5a3f2685efa1c440e5832b348204d1db5d98cc4 (patch) | |
tree | e401ebea4c5912e0f0f0e4178677bda586c46ce0 | |
parent | bb834ea8e8a0750dbaba30e863f7d84b81510399 (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@24420 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 18f6aa54a..4cbf62548 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -119,6 +119,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define EXPIRY_GUARD_PCT 0.20 /* Percentage of expires timeout to use when below EXPIRY_GUARD_LIMIT */ +#define SIP_LEN_CONTACT 256 + static int max_expiry = DEFAULT_MAX_EXPIRY; static int default_expiry = DEFAULT_DEFAULT_EXPIRY; @@ -622,7 +624,7 @@ static struct sip_pvt { char exten[AST_MAX_EXTENSION]; /*!< Extension where to start */ char refer_to[AST_MAX_EXTENSION]; /*!< Place to store REFER-TO extension */ char referred_by[AST_MAX_EXTENSION]; /*!< Place to store REFERRED-BY extension */ - char refer_contact[AST_MAX_EXTENSION]; /*!< Place to store Contact info from a REFER extension */ + char refer_contact[SIP_LEN_CONTACT]; /*!< Place to store Contact info from a REFER extension */ struct sip_pvt *refer_call; /*!< Call we are referring */ struct sip_route *route; /*!< Head of linked list of routing steps (fm Record-Route) */ int route_persistant; /*!< Is this the "real" route? */ @@ -642,16 +644,16 @@ static struct sip_pvt { char peername[256]; /*!< [peer] name, not set if [user] */ char authname[256]; /*!< Who we use for authentication */ char uri[256]; /*!< Original requested URI */ - char okcontacturi[256]; /*!< URI from the 200 OK on INVITE */ + char okcontacturi[SIP_LEN_CONTACT]; /*!< URI from the 200 OK on INVITE */ char peersecret[256]; /*!< Password */ char peermd5secret[256]; struct sip_auth *peerauth; /*!< Realm authentication */ char cid_num[256]; /*!< Caller*ID */ char cid_name[256]; /*!< Caller*ID */ char via[256]; /*!< Via: header */ - char fullcontact[128]; /*!< The Contact: that the UA registers with us */ + char fullcontact[SIP_LEN_CONTACT]; /*!< The Contact: that the UA registers with us */ char accountcode[AST_MAX_ACCOUNT_CODE]; /*!< Account code */ - char our_contact[256]; /*!< Our contact header */ + char our_contact[SIP_LEN_CONTACT]; /*!< Our contact header */ char *rpid; /*!< Our RPID header */ char *rpid_from; /*!< Our RPID From header */ char realm[MAXHOSTNAMELEN]; /*!< Authorization realm */ @@ -763,7 +765,7 @@ struct sip_peer { char regexten[AST_MAX_EXTENSION]; /*!< Extension to register (if regcontext is used) */ char fromuser[80]; /*!< From: user when calling this peer */ char fromdomain[MAXHOSTNAMELEN]; /*!< From: domain when calling this peer */ - char fullcontact[256]; /*!< Contact registered with us (not in sip.conf) */ + char fullcontact[SIP_LEN_CONTACT]; /*!< Contact registered with us (not in sip.conf) */ char cid_num[80]; /*!< Caller ID num */ char cid_name[80]; /*!< Caller ID name */ int callingpres; /*!< Calling id presentation */ @@ -826,7 +828,7 @@ struct sip_registry { char hostname[MAXHOSTNAMELEN]; /*!< Domain or host we register to */ char secret[80]; /*!< Password in clear text */ char md5secret[80]; /*!< Password in md5 */ - char contact[256]; /*!< Contact extension */ + char contact[SIP_LEN_CONTACT]; /*!< Contact extension */ char random[80]; int expire; /*!< Sched ID of expiration */ int regattempts; /*!< Number of attempts (since the last success) */ @@ -4054,7 +4056,7 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, char *msg, stru snprintf(tmp, sizeof(tmp), "%d", p->expiry); add_header(resp, "Expires", tmp); if (p->expiry) { /* Only add contact if we have an expiry time */ - char contact[256]; + char contact[SIP_LEN_CONTACT]; snprintf(contact, sizeof(contact), "%s;expires=%d", p->our_contact, p->expiry); add_header(resp, "Contact", contact); /* Not when we unregister */ } @@ -5815,7 +5817,7 @@ static void reg_source_db(struct sip_peer *peer) /*! \brief parse_ok_contact: Parse contact header for 200 OK on INVITE ---*/ static int parse_ok_contact(struct sip_pvt *pvt, struct sip_request *req) { - char contact[250]; + char contact[SIP_LEN_CONTACT]; char *c, *n, *pt; int port; struct hostent *hp; @@ -5891,8 +5893,8 @@ enum parse_register_result { /*! \brief parse_register_contact: Parse contact header and save registration ---*/ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, struct sip_peer *p, struct sip_request *req) { - char contact[80]; - char data[256]; + char contact[BUFSIZ]; + char data[BUFSIZ]; char iabuf[INET_ADDRSTRLEN]; char *expires = get_header(req, "Expires"); int expiry = atoi(expires); |