Browse code

core: parser contact - proper update of length in skip_name()

- stop walking name also for unquoted ;, being special char
- small typo

Daniel-Constantin Mierla authored on 07/09/2021 13:36:20
Showing 1 changed files
... ...
@@ -147,10 +147,10 @@ static inline int skip_name(str* _s)
147 147
 					return 0;
148 148
 				}
149 149
 
150
-				if (*p == ':') {
150
+				if (*p == ':' || *p == ';') {
151 151
 					if (last_wsp) {
152
-						_s->s = last_wsp;
153 152
 						_s->len -= last_wsp - _s->s + 1;
153
+						_s->s = last_wsp;
154 154
 					}
155 155
 					return 0;
156 156
 				}
... ...
@@ -224,7 +224,7 @@ int parse_contacts(str* _s, contact_t** _c)
224 224
 
225 225
 		trim(&c->uri);
226 226
 		if((c->uri.len <= 0) || (c->uri.s + c->uri.len > sv.s + sv.len)) {
227
-			LM_ERR("invlid contact uri\n");
227
+			LM_ERR("invalid contact uri\n");
228 228
 			goto error;
229 229
 		}
230 230