Merge lp:~jturmel/gearmand/fix_segfault into lp:gearmand/1.0

Proposed by Josh Turmel on 2013-05-31
Status: Needs review
Proposed branch: lp:~jturmel/gearmand/fix_segfault
Merge into: lp:gearmand/1.0
Diff against target: 42 lines (+10/-6)
1 file modified
libgearman-server/plugins/queue/postgres/queue.cc (+10/-6)
To merge this branch: bzr merge lp:~jturmel/gearmand/fix_segfault
Reviewer Review Type Date Requested Status
Tangent Trunk 2013-05-31 Pending
Review via email: mp+166882@code.launchpad.net
To post a comment you must log in.
Brian Aker (brianaker) wrote :

This has merged. Thank you!

Brian Aker (brianaker) wrote :

BTW this was merged into 1.1.

Josh Turmel (jturmel) wrote :

Great, thanks!

On Fri, Jun 21, 2013 at 2:08 PM, Brian Aker <email address hidden> wrote:

> BTW this was merged into 1.1.
> --
> https://code.launchpad.net/~jturmel/gearmand/fix_segfault/+merge/166882
> You are the owner of lp:~jturmel/gearmand/fix_segfault.
>

Brian Aker (brianaker) wrote :

Please feel free to send more patches :)

On Jun 21, 2013, at 12:49 PM, Josh Turmel <email address hidden> wrote:

> Great, thanks!
>
>
> On Fri, Jun 21, 2013 at 2:08 PM, Brian Aker <email address hidden> wrote:
>
>> BTW this was merged into 1.1.
>> --
>> https://code.launchpad.net/~jturmel/gearmand/fix_segfault/+merge/166882
>> You are the owner of lp:~jturmel/gearmand/fix_segfault.
>>
>
> --
> https://code.launchpad.net/~jturmel/gearmand/fix_segfault/+merge/166882
> Your team Gearman-developers is subscribed to branch lp:gearmand/1.0.

Unmerged revisions

802. By Josh Turmel on 2013-05-31

Fix segfault

* Gearmand would segfault if you submitted an epoch job while using Postgres
  as the persistent queue

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libgearman-server/plugins/queue/postgres/queue.cc'
2--- libgearman-server/plugins/queue/postgres/queue.cc 2012-12-23 11:50:37 +0000
3+++ libgearman-server/plugins/queue/postgres/queue.cc 2013-05-31 19:49:25 +0000
4@@ -45,6 +45,8 @@
5 #include <gear_config.h>
6 #include <libgearman-server/common.h>
7 #include <libgearman-server/byte.h>
8+#include <stdint.h>
9+#include <inttypes.h>
10
11 #include <libgearman-server/plugins/queue/postgres/queue.h>
12 #include <libgearman-server/plugins/queue/base.h>
13@@ -261,22 +263,24 @@
14 (void)when;
15 gearmand::plugins::queue::Postgres *queue= (gearmand::plugins::queue::Postgres *)context;
16
17- char buffer[22];
18- snprintf(buffer, sizeof(buffer), "%u", static_cast<uint32_t>(priority));
19+ char priority_buffer[22];
20+ snprintf(priority_buffer, sizeof(priority_buffer), "%u", static_cast<uint32_t>(priority));
21+ char when_buffer[12];
22+ snprintf(when_buffer, sizeof(when_buffer), "%" PRId64, when);
23
24 const char *param_values[]= {
25- (char *)buffer,
26+ (char *)priority_buffer,
27 (char *)unique,
28 (char *)function_name,
29 (char *)data,
30- (char *)when };
31+ (char *)when_buffer };
32
33 int param_lengths[]= {
34- (int)strlen(buffer),
35+ (int)strlen(priority_buffer),
36 (int)unique_size,
37 (int)function_name_size,
38 (int)data_size,
39- (int)when };
40+ (int)strlen(when_buffer) };
41
42 int param_formats[] = { 0, 0, 0, 1, 0 };
43

Subscribers

People subscribed via source and target branches