Skip to content

Commit

Permalink
Fix a segfault when specifying an invalid host.
Browse files Browse the repository at this point in the history
If the --host argument did not contain a valid hostname to contact to, a
segmentation fault was raised because the return value from oauth_http_post and
oauth_http_get was not being properly checked.
  • Loading branch information
agimenez committed Feb 3, 2011
1 parent 7276d1a commit 03e07fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bti.c
Expand Up @@ -724,6 +724,11 @@ static int send_request(struct session *session)
free(req_url);
}

if (!reply) {
fprintf(stderr, "Error retrieving from URL (%s)\n", endpoint);
return 1;
}

if ((session->action != ACTION_UPDATE) &&
(session->action != ACTION_RETWEET))
parse_timeline(reply, session);
Expand Down

0 comments on commit 03e07fd

Please sign in to comment.