From 865f3f25c1e9b0a107e1b21ac9b110460c19bf4d Mon Sep 17 00:00:00 2001
From: dequis <dx@dxzone.com.ar>
Date: Sun, 29 Jan 2017 19:02:22 -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 1026eab3..59bda7ac 100644
a
|
b
|
file_transfer_t *imcb_file_send_start( struct im_connection *ic, char *handle, c |
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 c4efc657..56132ff1 100644
a
|
b
|
static gboolean prplcb_xfer_new_send_cb( gpointer data, gint fd, b_input_conditi |
108 | 108 | /* TODO(wilmer): After spreading some more const goodness in BitlBee, |
109 | 109 | remove the evil cast below. */ |
110 | 110 | px->ft = imcb_file_send_start( ic, (char*) who, xfer->filename, xfer->size ); |
| 111 | |
| 112 | if (!px->ft) { |
| 113 | return FALSE; |
| 114 | } |
111 | 115 | px->ft->data = px; |
112 | 116 | |
113 | 117 | px->ft->accept = prpl_xfer_accept; |