Fixed crash (NULL pointer dereference)
authorHarvie <tomas@mudrunka.cz>
Tue, 18 Jan 2011 13:20:48 +0000 (14:20 +0100)
committerHarvie <tomas@mudrunka.cz>
Tue, 18 Jan 2011 13:20:48 +0000 (14:20 +0100)
answerscripts.c

index 25d6cd6465e6b22ce79b08be197dd126eed5ba1d..54b757631f7a0ac969bc6f604b8392746b650fd0 100755 (executable)
@@ -117,6 +117,10 @@ static void received_im_msg_cb(PurpleAccount *account, char *who, char *buffer,
        //Launch job on background
        answerscripts_job *job = (answerscripts_job*) malloc(sizeof(answerscripts_job));
        job->pipe = popen(hook_script, "r");
+       if(job->pipe == NULL) {
+               fprintf(stderr,"Can't execute %s\n", hook_script);
+               return;
+       }
        job->conv = conv;
 
        #ifndef __WIN32__
This page took 0.126759 seconds and 4 git commands to generate.