Skip to content

Commit

Permalink
-fix via header of CANCEL request
Browse files Browse the repository at this point in the history
-fix crash in case of malformed paramless request uri in From header
-fix crash in case of From header display name with last value set to « \ »
  • Loading branch information
Jehan Monnier committed Sep 8, 2021
1 parent 9b953a4 commit d3f0651
Show file tree
Hide file tree
Showing 12 changed files with 6,532 additions and 6,507 deletions.
Binary file removed .DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions include/belle-sip/provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ BELLESIP_EXPORT int belle_sip_provider_add_authorization(belle_sip_provider_t *p
**/
BELLESIP_EXPORT belle_sip_dialog_t* belle_sip_provider_find_dialog(const belle_sip_provider_t *prov, const char* call_id,const char* local_tag,const char* remote_tag);

/**
* Provides access to a specific dialog
* @param prov object
* @param call_if of the dialog
* @param remote_tag of the dialog
* @returns dialog that correspond to these parameters or NULL if not found
*
**/
BELLESIP_EXPORT belle_sip_dialog_t* belle_sip_provider_find_dialog_with_remote_tag(const belle_sip_provider_t *prov, const char* call_id,const char* remote_tag);


/**
* Enable rport in via header. Enabled by default
* @param prov
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ if(ENABLE_SHARED)
set_target_properties(bellesip PROPERTIES
FRAMEWORK TRUE
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.belle-sip
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/build/osx/Info.plist.in"
MACOSX_FRAMEWORK_INFO_PLIST "${PROJECT_SOURCE_DIR}/build/osx/Info.plist.in"
RESOURCE "${BELLESIP_RESOURCES}"
PUBLIC_HEADER "${BELLE_SIP_HEADER_FILES}"
)
Expand Down
5 changes: 3 additions & 2 deletions src/belle_sip_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,13 @@ char* belle_generic_uri_to_escaped_path(const char* buff) {
}

char* belle_sip_string_to_backslash_less_unescaped_string(const char* buff) {
char *output_buff=belle_sip_malloc(strlen(buff)+1);
size_t buff_len = strlen(buff);
char *output_buff=belle_sip_malloc(buff_len+1);
unsigned int i;
unsigned int out_buff_index=0;

for(i=0; buff[i] != '\0'; i++) {
if (buff[i] == '\\') {
if (buff[i] == '\\' && i + 1 < buff_len ) { /*make sure escaped caracter exist*/
i++;/*skip \*/
}
/*make sure to only remove one \ in case of \\*/
Expand Down
2 changes: 1 addition & 1 deletion src/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ int _belle_sip_dialog_match(belle_sip_dialog_t *obj, const char *call_id, const
/*Dialog created by notify matching subscription are still in NULL state if (obj->state==BELLE_SIP_DIALOG_NULL) belle_sip_fatal("_belle_sip_dialog_match() must not be used for dialog in null state.");*/
dcid=belle_sip_header_call_id_get_call_id(obj->call_id);
return strcmp(dcid,call_id)==0
&& strcmp(obj->local_tag,local_tag)==0
&& (!local_tag || strcmp(obj->local_tag,local_tag)==0) //local tag is not checked if not provided
&& obj->remote_tag /* handle 180 without to tag */ && remote_tag && strcmp(obj->remote_tag,remote_tag)==0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/grammars/belle_sip_message.g
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ scope { belle_generic_uri_t* current; }
catch [ANTLR3_RECOGNITION_EXCEPTION]
{
belle_sip_message("[\%s] reason [\%s]",(const char*)EXCEPTION->name,(const char*)EXCEPTION->message);
belle_sip_object_unref($generic_uri::current);
belle_sip_object_unref($ret);
$ret=NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/grammars/belle_sip_messageLexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This C source file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2021-05-13 15:53:11
* - On : 2021-09-07 16:55:34
* - for the lexer : belle_sip_messageLexerLexer
*
* Editing it, at least manually, is not wise.
Expand Down
2 changes: 1 addition & 1 deletion src/grammars/belle_sip_messageLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This C header file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2021-05-13 15:53:11
* - On : 2021-09-07 16:55:34
* - for the lexer : belle_sip_messageLexerLexer
*
* Editing it, at least manually, is not wise.
Expand Down
Loading

0 comments on commit d3f0651

Please sign in to comment.