Line 0
Link Here
|
|
|
1 |
--- source3/lib/messages.c.orig 2020-02-28 08:59:35 UTC |
2 |
+++ source3/lib/messages.c |
3 |
@@ -157,7 +157,7 @@ struct messaging_rec *messaging_rec_create( |
4 |
|
5 |
{ |
6 |
struct messaging_rec rec; |
7 |
- int64_t fds64[num_fds]; |
8 |
+ int64_t fds64[MAX(1, num_fds)]; |
9 |
size_t i; |
10 |
|
11 |
for (i=0; i<num_fds; i++) { |
12 |
@@ -391,7 +391,7 @@ static void messaging_recv_cb(struct tevent_context *e |
13 |
private_data, struct messaging_context); |
14 |
struct server_id_buf idbuf; |
15 |
struct messaging_rec rec; |
16 |
- int64_t fds64[MIN(num_fds, INT8_MAX)]; |
17 |
+ int64_t fds64[MAX(1, MIN(num_fds, INT8_MAX))]; |
18 |
size_t i; |
19 |
|
20 |
if (msg_len < MESSAGE_HDR_LENGTH) { |
21 |
@@ -1375,7 +1375,7 @@ static void messaging_dispatch_rec(struct messaging_co |
22 |
|
23 |
if (ev != msg_ctx->event_ctx) { |
24 |
struct iovec iov; |
25 |
- int fds[rec->num_fds]; |
26 |
+ int fds[MAX(1, rec->num_fds)]; |
27 |
int ret; |
28 |
|
29 |
/* |