kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
April 2013
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
38 participants
401 discussions
Start a n
N
ew thread
git:admorten/sca: modules/sca: add SCA_DB_DEFAULT_FETCH_ROW_COUNT
by Andrew Mortensen
Module: sip-router Branch: admorten/sca Commit: fbd7d5a4349dc084fe3ee817edc5e3ddfd5b8eb6 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fbd7d5a…
Author: Andrew Mortensen <admorten(a)isc.upenn.edu> Committer: Andrew Mortensen <admorten(a)isc.upenn.edu> Date: Mon Apr 15 20:16:36 2013 -0400 modules/sca: add SCA_DB_DEFAULT_FETCH_ROW_COUNT --- modules/sca/sca_db.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules/sca/sca_db.h b/modules/sca/sca_db.h index 2a5e489..99d4d06 100644 --- a/modules/sca/sca_db.h +++ b/modules/sca/sca_db.h @@ -31,6 +31,8 @@ #define SCA_DB_SUBSCRIPTIONS_NUM_COLUMNS 12 +#define SCA_DB_DEFAULT_FETCH_ROW_COUNT 1000 + enum { SCA_DB_SUBS_SUBSCRIBER_COL = 0, SCA_DB_SUBS_AOR_COL = 1,
11 years, 9 months
1
0
0
0
git:admorten/sca: modules/sca: use DB fetch queries when restoring subscribers from database.
by Andrew Mortensen
Module: sip-router Branch: admorten/sca Commit: 1c7f74c66aeba6432c207199561086ad0ca13181 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1c7f74c…
Author: Andrew Mortensen <admorten(a)isc.upenn.edu> Committer: Andrew Mortensen <admorten(a)isc.upenn.edu> Date: Mon Apr 15 20:11:08 2013 -0400 modules/sca: use DB fetch queries when restoring subscribers from database. - Previously used standard query, exhausting pkg memory when subscriber count is high. --- modules/sca/sca_subscribe.c | 87 +++++++++++++++++++++++++------------------ 1 files changed, 51 insertions(+), 36 deletions(-) diff --git a/modules/sca/sca_subscribe.c b/modules/sca/sca_subscribe.c index d62e7bf..cf8feb7 100644 --- a/modules/sca/sca_subscribe.c +++ b/modules/sca/sca_subscribe.c @@ -272,56 +272,71 @@ sca_subscriptions_restore_from_db( sca_mod *scam ) result_columns[ i ] = column_names[ i ]; } - if ( scam->db_api->query( db_con, NULL, NULL, NULL, result_columns, - 0, SCA_DB_SUBSCRIPTIONS_NUM_COLUMNS, - 0, &result ) < 0 ) { + rc = db_fetch_query( scam->db_api, SCA_DB_DEFAULT_FETCH_ROW_COUNT, + db_con, NULL, NULL, NULL, result_columns, + 0, SCA_DB_SUBSCRIPTIONS_NUM_COLUMNS, + 0, &result ); + switch ( rc ) { + default: + case -1: LM_ERR( "sca_subscriptions_restore_from_db: query failed" ); goto done; + + case 0: + LM_WARN( "sca_subscriptions_restore_from_db: DB module does " + "not support fetch, query returning all values..." ); + /* fall through */ + + case 1: + break; } - rows = RES_ROWS( result ); - num_rows = RES_ROW_N( result ); + do { + rows = RES_ROWS( result ); + num_rows = RES_ROW_N( result ); - for ( i = 0; i < num_rows; i++ ) { - memset( &sub, 0, sizeof( sca_subscription )); + for ( i = 0; i < num_rows; i++ ) { + memset( &sub, 0, sizeof( sca_subscription )); - row_values = ROW_VALUES( rows + i ); + row_values = ROW_VALUES( rows + i ); - sub.expires = row_values[ SCA_DB_SUBS_EXPIRES_COL ].val.time_val; - if ( sub.expires < now ) { - continue; - } + sub.expires = row_values[ SCA_DB_SUBS_EXPIRES_COL ].val.time_val; + if ( sub.expires < now ) { + continue; + } - if ( sca_subscription_from_db_row_values( row_values, &sub ) < 0 ) { - LM_ERR( "sca_subscriptions_restore_from_db: skipping bad result " - "at index %d", i ); - continue; - } + if ( sca_subscription_from_db_row_values( row_values, &sub ) < 0 ) { + LM_ERR( "sca_subscriptions_restore_from_db: skipping bad result " + "at index %d", i ); + continue; + } - if ( sca_subscription_copy_subscription_key( &sub, &sub_key ) < 0 ) { - LM_ERR( "sca_subscriptions_restore_from_db: failed to copy " - "subscription key %.*s%s", STR_FMT( &sub.subscriber ), - sca_event_name_from_type( sub.event )); - continue; - } + if ( sca_subscription_copy_subscription_key( &sub, &sub_key ) < 0 ) { + LM_ERR( "sca_subscriptions_restore_from_db: failed to copy " + "subscription key %.*s%s", STR_FMT( &sub.subscriber ), + sca_event_name_from_type( sub.event )); + continue; + } - idx = sca_hash_table_index_for_key( sca->subscriptions, &sub_key ); - pkg_free( sub_key.s ); + idx = sca_hash_table_index_for_key( sca->subscriptions, &sub_key ); + pkg_free( sub_key.s ); - sca_hash_table_lock_index( sca->subscriptions, idx ); + sca_hash_table_lock_index( sca->subscriptions, idx ); - if ( sca_subscription_save_unsafe( scam, &sub, idx, - SCA_SUBSCRIPTION_CREATE_OPT_RAW_EXPIRES ) < 0 ) { - LM_ERR( "sca_subscriptions_restore_from_db: failed to restore " - "%s subscription from %.*s to the hash table", - sca_event_name_from_type( sub.event ), - STR_FMT( &sub.subscriber )); + if ( sca_subscription_save_unsafe( scam, &sub, idx, + SCA_SUBSCRIPTION_CREATE_OPT_RAW_EXPIRES ) < 0 ) { + LM_ERR( "sca_subscriptions_restore_from_db: failed to restore " + "%s subscription from %.*s to the hash table", + sca_event_name_from_type( sub.event ), + STR_FMT( &sub.subscriber )); - /* fall through to unlock index */ - } + /* fall through to unlock index */ + } - sca_hash_table_unlock_index( sca->subscriptions, idx ); - } + sca_hash_table_unlock_index( sca->subscriptions, idx ); + } + } while ( db_fetch_next( scam->db_api, SCA_DB_DEFAULT_FETCH_ROW_COUNT, + db_con, &result ) == 1 && num_rows > 0 ); scam->db_api->free_result( db_con, result );
11 years, 9 months
1
0
0
0
git:admorten/sca: modules/sca: only check if callee is SCA if callee_aor has a value.
by Andrew Mortensen
Module: sip-router Branch: admorten/sca Commit: 6071ddce7f1922d3df79a0e6d34ef44e187d93b6 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6071ddc…
Author: Andrew Mortensen <admorten(a)isc.upenn.edu> Committer: Andrew Mortensen <admorten(a)isc.upenn.edu> Date: Mon Apr 15 20:09:01 2013 -0400 modules/sca: only check if callee is SCA if callee_aor has a value. --- modules/sca/sca_call_info.c | 40 ++++++++++++++++++++++------------------ 1 files changed, 22 insertions(+), 18 deletions(-) diff --git a/modules/sca/sca_call_info.c b/modules/sca/sca_call_info.c index 6766553..594bcfc 100644 --- a/modules/sca/sca_call_info.c +++ b/modules/sca/sca_call_info.c @@ -700,27 +700,31 @@ sca_call_info_seize_held_call( sip_msg_t *msg, sca_call_info *call_info, sca_hash_table_unlock_index( sca->appearances, slot_idx ); slot_idx = -1; - if ( sca_uri_lock_if_shared_appearance( sca, &callee_aor, &slot_idx )) { - app = sca_appearance_for_tags_unsafe( sca, &callee_aor, - &prev_callid, &prev_totag, NULL, slot_idx ); - if ( app == NULL ) { - LM_ERR( "sca_call_info_seize_held_call: failed to find " - "appearance of %.*s with dialog %.*s;%.*s", - STR_FMT( &callee_aor ), STR_FMT( &prev_callid ), - STR_FMT( &prev_totag )); - goto done; - } + if ( callee_aor.s != NULL && callee_aor.len > 0 ) { + if ( sca_uri_lock_if_shared_appearance( sca, &callee_aor, &slot_idx )) { + app = sca_appearance_for_tags_unsafe( sca, &callee_aor, + &prev_callid, &prev_totag, NULL, slot_idx ); + if ( app == NULL ) { + LM_ERR( "sca_call_info_seize_held_call: failed to find " + "appearance of %.*s with dialog %.*s;%.*s", + STR_FMT( &callee_aor ), STR_FMT( &prev_callid ), + STR_FMT( &prev_totag )); + goto done; + } - app->flags |= SCA_APPEARANCE_FLAG_CALLEE_PENDING; + app->flags |= SCA_APPEARANCE_FLAG_CALLEE_PENDING; - if ( sca_appearance_update_callee_unsafe( app, contact_uri ) < 0 ) { - LM_ERR( "sca_call_info_seize_held_call: failed to update callee" ); - goto done; - } - if ( sca_appearance_update_dialog_unsafe( app, &msg->callid->body, + if ( sca_appearance_update_callee_unsafe( app, contact_uri ) < 0 ) { + LM_ERR( "sca_call_info_seize_held_call: " + "failed to update callee" ); + goto done; + } + if ( sca_appearance_update_dialog_unsafe( app, &msg->callid->body, &to->tag_value, &from->tag_value ) < 0 ) { - LM_ERR( "sca_call_info_seize_held_call: failed to update dialog" ); - goto done; + LM_ERR( "sca_call_info_seize_held_call: " + "failed to update dialog" ); + goto done; + } } }
11 years, 9 months
1
0
0
0
git:admorten/sca: modules/sca: add check for empty AoR in lock_shared_appearance calls.
by Andrew Mortensen
Module: sip-router Branch: admorten/sca Commit: db581657408218810cac67a6376a96b6fb1c6f94 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=db58165…
Author: Andrew Mortensen <admorten(a)isc.upenn.edu> Committer: Andrew Mortensen <admorten(a)isc.upenn.edu> Date: Mon Apr 15 17:17:05 2013 -0400 modules/sca: add check for empty AoR in lock_shared_appearance calls. - Sanity checking --- modules/sca/sca_appearance.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/modules/sca/sca_appearance.c b/modules/sca/sca_appearance.c index 5fb180f..dea9ab4 100644 --- a/modules/sca/sca_appearance.c +++ b/modules/sca/sca_appearance.c @@ -780,6 +780,10 @@ sca_uri_lock_shared_appearance( sca_mod *scam, str *aor ) sca_appearance_list *app_list; int slot_idx; + if ( SCA_STR_EMPTY( aor )) { + return( -1 ); + } + slot_idx = sca_hash_table_index_for_key( scam->appearances, aor ); slot = sca_hash_table_slot_for_index( scam->appearances, slot_idx ); @@ -802,6 +806,11 @@ sca_uri_lock_if_shared_appearance( sca_mod *scam, str *aor, int *slot_idx ) assert( slot_idx != NULL ); + if ( SCA_STR_EMPTY( aor )) { + *slot_idx = -1; + return( 0 ); + } + *slot_idx = sca_hash_table_index_for_key( scam->appearances, aor ); slot = sca_hash_table_slot_for_index( scam->appearances, *slot_idx );
11 years, 9 months
1
0
0
0
git:master: auth: skip processing of PRACK in consume_credentials()
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 2a77ed2bdc9341ecf7d7200e420a1f49e4e9b6ab URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2a77ed2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sun Apr 14 10:11:29 2013 +0200 auth: skip processing of PRACK in consume_credentials() - report and patch suggestions by Jorj Bauer --- modules/auth/auth_mod.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/auth/auth_mod.c b/modules/auth/auth_mod.c index 861f92f..cdfe459 100644 --- a/modules/auth/auth_mod.c +++ b/modules/auth/auth_mod.c @@ -397,16 +397,16 @@ int consume_credentials(struct sip_msg* msg) { struct hdr_field* h; int len; - + + /* skip requests that can't be authenticated */ + if (msg->REQ_METHOD & (METHOD_ACK|METHOD_CANCEL|METHOD_PRACK)) + return -1; get_authorized_cred(msg->authorization, &h); if (!h) { get_authorized_cred(msg->proxy_auth, &h); if (!h) { - if (msg->REQ_METHOD != METHOD_ACK - && msg->REQ_METHOD != METHOD_CANCEL) { - LOG(L_ERR, "auth:consume_credentials: No authorized " + LOG(L_ERR, "auth:consume_credentials: No authorized " "credentials found (error in scripts)\n"); - } return -1; } }
11 years, 9 months
1
0
0
0
git:master: tls: fix compiler warning
by Ovidiu Sas
Module: sip-router Branch: master Commit: 56f7a8b98778f9c9b71f613a5df5eaa1705a7a00 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=56f7a8b…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Sat Apr 13 15:37:18 2013 -0400 tls: fix compiler warning - tls_config.c:61:19: warning: �t.val.s� is used uninitialized in this function [-Wuninitialized] --- modules/tls/tls_config.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules/tls/tls_config.c b/modules/tls/tls_config.c index fc4a9c0..0083893 100644 --- a/modules/tls/tls_config.c +++ b/modules/tls/tls_config.c @@ -58,13 +58,13 @@ static int parse_ipv6(struct ip_addr* ip, cfg_token_t* token, struct ip_addr* ipv6; str ip6_str; - ip6_str.s = t.val.s; while(1) { ret = cfg_get_token(&t, st, 0); if (ret != 0) goto err; if (t.type == ']') break; if (t.type != CFG_TOKEN_ALPHA && t.type != ':') goto err; } + ip6_str.s = t.val.s; ip6_str.len = (int)(long)(t.val.s - ip6_str.s); ipv6 = str2ip6(&ip6_str);
11 years, 9 months
1
0
0
0
git:master: siputils: added new function is_supported(option)
by Juha Heinanen
Module: sip-router Branch: master Commit: d992d3b223a3319a360f033d1d904873160f706e URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d992d3b…
Author: Juha Heinanen <jh(a)tutpro.com> Committer: Juha Heinanen <jh(a)tutpro.com> Date: Sat Apr 13 17:44:15 2013 +0300 siputils: added new function is_supported(option) - Checks if given option is listed in any of the Supported: headers of the request. --- modules/siputils/README | 69 +++++++++++++++++++----------- modules/siputils/doc/siputils_admin.xml | 23 ++++++++++ modules/siputils/sipops.c | 17 +++++++ modules/siputils/sipops.h | 1 + modules/siputils/siputils.c | 70 +++++++++++++++++++++++++++++++ 5 files changed, 154 insertions(+), 26 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=d99…
11 years, 9 months
1
0
0
0
git:4.0: parser: safety check for max port length in URI
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: 31f76fc50ec838b301dede678c97676d63355b4b URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=31f76fc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Tue Apr 9 00:18:35 2013 +0200 parser: safety check for max port length in URI - can't be longer than 5, a port being 16b value - reported by Kevin Wojtysiak (cherry picked from commit 13fd48f89555f5421e8285669e303bcefe44f149) --- parser/parse_uri.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/parser/parse_uri.c b/parser/parse_uri.c index e2e16f6..84f35c6 100644 --- a/parser/parse_uri.c +++ b/parser/parse_uri.c @@ -1222,6 +1222,10 @@ int parse_uri(char* buf, int len, struct sip_uri* uri) goto error_bad_uri; break; /* do nothing, avoids a compilation warning */ } + + if(uri->port.len>5) + goto error_invalid_port; + #ifdef EXTRA_DEBUG /* do stuff */ DBG("parsed uri:\n type=%d user=<%.*s>(%d)\n passwd=<%.*s>(%d)\n" @@ -1285,6 +1289,10 @@ error_bad_port: *p, state, (int)(p-buf), ZSW(buf), (int)(p-buf), len, ZSW(buf), len); goto error_exit; +error_invalid_port: + DBG("parse_uri: bad port in uri: [%.*s] in <%.*s>\n", + uri->port.len, uri->port.s, len, ZSW(buf)); + goto error_exit; error_bad_uri: DBG("parse_uri: bad uri, state %d" " parsed: <%.*s> (%d) / <%.*s> (%d)\n",
11 years, 9 months
1
0
0
0
git:4.0: rr: use port. len to check for buffer overflow instead of max port len
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: b2b26c811a7275dbdba90236f3cfc874fd117681 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b2b26c8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Tue Apr 9 00:15:47 2013 +0200 rr: use port.len to check for buffer overflow instead of max port len - reported by Kevin Wojtysiak (cherry picked from commit 28a8b87885e373bee8cc81985277ae718973fdfd) --- modules/rr/loose.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules/rr/loose.c b/modules/rr/loose.c index 268522c..ccd08d9 100644 --- a/modules/rr/loose.c +++ b/modules/rr/loose.c @@ -367,7 +367,7 @@ static inline int get_maddr_uri(str *uri, struct sip_uri *puri) return 0; /* sip: + maddr + : + port */ - if( (puri->maddr_val.len) > (127 - 10) ) + if( (puri->maddr_val.len) > (127 - 6 - puri->port.len) ) { LM_ERR( "Too long maddr parameter\n"); return RR_ERROR;
11 years, 9 months
1
0
0
0
git:4.0: core: safety check for content-lenght size in tcp read
by Daniel-Constantin Mierla
Module: sip-router Branch: 4.0 Commit: a49467e98dc721a1e4dbd9ba547d72aa38018883 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a49467e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Fri Apr 12 00:50:24 2013 +0200 core: safety check for content-lenght size in tcp read - avoid getting negative - upon a report by Kevin Wojtysiak (cherry picked from commit 3c54420914c011bdd874a97c4c40ee9dacb59788) --- tcp_read.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/tcp_read.c b/tcp_read.c index b969e6c..618e05a 100644 --- a/tcp_read.c +++ b/tcp_read.c @@ -805,11 +805,25 @@ int tcp_read_headers(struct tcp_connection *c, int* read_flags) case '\r': case ' ': case '\t': /* FIXME: check if line contains only WS */ + if(r->content_len<0) { + LOG(L_ERR, "bad Content-Length header value %d in" + " state %d\n", r->content_len, r->state); + r->content_len=0; + r->error=TCP_REQ_BAD_LEN; + r->state=H_SKIP; /* skip now */ + } r->state=H_SKIP; r->flags|=F_TCP_REQ_HAS_CLEN; break; case '\n': /* end of line, parse successful */ + if(r->content_len<0) { + LOG(L_ERR, "bad Content-Length header value %d in" + " state %d\n", r->content_len, r->state); + r->content_len=0; + r->error=TCP_REQ_BAD_LEN; + r->state=H_SKIP; /* skip now */ + } r->state=H_LF; r->flags|=F_TCP_REQ_HAS_CLEN; break;
11 years, 9 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
41
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Results per page:
10
25
50
100
200