From 8fcf15ab04fd9b4786b1d01c148ab8b83400f84d Mon Sep 17 00:00:00 2001
From: dequis <dx@dxzone.com.ar>
Date: Sun, 13 Nov 2016 16:52:43 -0300
Subject: [PATCH] Fix null pointer dereference on ft attempts from non-existing
users
This is a backported combination of 701ab81 (included in 3.5) and XXXXXX
(included in 3.5.1)
---
protocols/bee_ft.c | 2 +-
protocols/purple/ft.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/protocols/bee_ft.c b/protocols/bee_ft.c
index 27fd4eac..916b2e88 100644
a
|
b
|
file_transfer_t *imcb_file_send_start(struct im_connection *ic, char *handle, ch |
30 | 30 | bee_t *bee = ic->bee; |
31 | 31 | bee_user_t *bu = bee_user_by_handle(bee, ic, handle); |
32 | 32 | |
33 | | if (bee->ui->ft_in_start) { |
| 33 | if (bee->ui->ft_in_start && bu) { |
34 | 34 | return bee->ui->ft_in_start(bee, bu, file_name, file_size); |
35 | 35 | } else { |
36 | 36 | return NULL; |
diff --git a/protocols/purple/ft.c b/protocols/purple/ft.c
index 320fc887..4d785291 100644
a
|
b
|
static gboolean prplcb_xfer_new_send_cb(gpointer data, gint fd, b_input_conditio |
107 | 107 | /* TODO(wilmer): After spreading some more const goodness in BitlBee, |
108 | 108 | remove the evil cast below. */ |
109 | 109 | px->ft = imcb_file_send_start(ic, (char *) who, xfer->filename, xfer->size); |
| 110 | |
| 111 | if (!px->ft) { |
| 112 | return FALSE; |
| 113 | } |
110 | 114 | px->ft->data = px; |
111 | 115 | |
112 | 116 | px->ft->accept = prpl_xfer_accept; |