Skip to content

Commit

Permalink
parse_uri: Parse the port into an unsigned integer (OSS-Fuzz)
Browse files Browse the repository at this point in the history
Fixes OSS-Fuzz#51605

(cherry picked from commit b4a72a5)
  • Loading branch information
liviuchircu committed Oct 10, 2022
1 parent c46af85 commit 7e12f00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parser/parse_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
str* param_val; /* current param val */
str user;
str password;
int port_no;
unsigned int port_no;
register char* p;
char* end;
char* pass;
Expand All @@ -372,7 +372,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
#define case_port( ch, var, ovf_check1, ovf_check2) \
case ch: \
if (ovf_check1) \
(var)=(var)*10+ch-'0'; \
(var)=(var)*10+(ch-'0'); \
if (ovf_check2 && (var) > USHRT_MAX) \
goto error_bad_port; \
break
Expand Down

0 comments on commit 7e12f00

Please sign in to comment.