Browse Source

msg_parser: fix To parameter with null value parsing

Alekzander Spiridonov 11 years ago
parent
commit
14183ffa5e
2 changed files with 7 additions and 2 deletions
  1. 1 1
      msg_translator.c
  2. 6 1
      parser/parse_addr_spec.c

+ 1 - 1
msg_translator.c

@@ -2406,7 +2406,7 @@ char * build_res_buf_from_sip_req( unsigned int code, str *text ,str *new_tag,
 			case HDR_TO_T:
 				if (new_tag && new_tag->len) {
 					to_tag=get_to(msg)->tag_value;
-					if (to_tag.len )
+					if ( to_tag.len || to_tag.s )
 						len+=new_tag->len-to_tag.len;
 					else
 						len+=new_tag->len+TOTAG_TOKEN_LEN/*";tag="*/;

+ 6 - 1
parser/parse_addr_spec.c

@@ -546,7 +546,12 @@ endofheader:
 			break;
 		case S_PARA_VALUE:
 			/* parameter with null value, e.g. foo= */
-			param->value.s=tmp;
+			if ( status==F_CRLF )
+				param->value.s=tmp-2;
+			else if ( status==F_CR || status==F_LF )
+				param->value.s=tmp-1;
+			else
+				param->value.s=tmp;
 			param->value.len=0;
 			add_param(param, to_b, newparam);
 			saved_status=E_PARA_VALUE;