Przeglądaj źródła

core: parse uri - detect empty user when @ is found

Daniel-Constantin Mierla 3 lat temu
rodzic
commit
0c101ffe71
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      src/core/parser/parse_uri.c

+ 4 - 0
src/core/parser/parse_uri.c

@@ -434,6 +434,10 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
 						/* found the user*/
 						uri->user.s=s;
 						uri->user.len=p-s;
+						if(uri->user.len<=0) {
+							/* at '@' and no user part */
+							goto error_bad_char;
+						}
 						state=URI_HOST;
 						found_user=1;
 						s=p+1; /* skip '@' */