Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: initialize output pointers to NULL before calling strto[ff,l,ul] #12995

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/strtoofft.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static int get_char(char c, int base)
CURLofft curlx_strtoofft(const char *str, char **endp, int base,
curl_off_t *num)
{
char *end;
char *end = NULL;
curl_off_t number;
errno = 0;
*num = 0; /* clear by default */
Expand Down
4 changes: 2 additions & 2 deletions lib/urlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host,
portptr = strchr(hostname, ':');

if(portptr) {
char *rest;
char *rest = NULL;
long port;
size_t keep = portptr - hostname;

Expand Down Expand Up @@ -681,7 +681,7 @@ static int ipv4_normalize(struct dynbuf *host)
return HOST_IPV6;

while(!done) {
char *endp;
char *endp = NULL;
unsigned long l;
if(!ISDIGIT(*c))
/* most importantly this doesn't allow a leading plus or minus */
Expand Down