Skip to content

Commit

Permalink
gpaste: prevent potential SEGV
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  • Loading branch information
Keruspe committed May 19, 2012
1 parent b8f2551 commit ffa347c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gpaste/gpaste.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ show_history (GPasteClient *client,
GError **error)
{
gchar **history = g_paste_client_get_history (client, error);

if (!*error)
{
unsigned int i = 0;
Expand Down Expand Up @@ -91,6 +92,12 @@ main (int argc, char *argv[])
GError *error = NULL;
const gchar *arg1, *arg2;

if (!client)
{
fprintf (stderr, _("Couldn't connect to GPaste daemon.\n"));
return 1;
}

if (!isatty (fileno (stdin)))
{
/* We are being piped */
Expand Down

0 comments on commit ffa347c

Please sign in to comment.