SEGV in gearmand

Bug #1456172 reported by Xeno
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
New
Undecided
Unassigned

Bug Description

In libgearman-server/server.cc there is a gearmand_log_debug line that tries to print the server_job->function on a GEARMAN_COMMAND_WORK_EXCEPTION.
server_job is sometimes NULL, and since the check for server_job == NULL is after the gearmand_log_debug, gearmand crashes.

I think it should be like this:
[code]
      if (server_job == NULL)
      {
        return _server_error_packet(GEARMAN_DEFAULT_LOG_PARAM, server_con, GEARMAN_JOB_NOT_FOUND,
                                    gearman_literal_param("An exception was received for a job that does not exist"));
      }
      gearmand_log_debug(GEARMAN_DEFAULT_LOG_PARAM,
                         "Exception being sent from: %.*s(%lu)",
                         server_job->function->function_name_size, server_job->function->function_name, server_job->function->function_name_size);
[/code]

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.