summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-11-26 22:49:39 (GMT)
committerDan Williams <dcbw@redhat.com>2012-11-27 15:56:25 (GMT)
commita7167b93b9f077e063024754ad2d566fc65f76b4 (patch)
treeec6b74e47086c1bf2141d1bd568603096dadbba6
parent6106d1d6a2b05a031c54c75861363b199136e417 (diff)
port-probe: fix crash in buffer-full processing
Signal was attached with user_data as MMPortProbe*, but serial_buffer_full() treated user_data as a PortProbeRunTask*. Hillarity ensued.
-rw-r--r--src/mm-port-probe.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 37c2baf..598ceb6 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -880,7 +880,7 @@ static const guint8 zerobuf[32] = {
static void
serial_buffer_full (MMSerialPort *serial,
GByteArray *buffer,
- PortProbeRunTask *task)
+ MMPortProbe *self)
{
const gchar **iter;
size_t iter_len;
@@ -892,7 +892,11 @@ serial_buffer_full (MMSerialPort *serial,
if ( (buffer->len >= sizeof (zerobuf))
&& (memcmp (buffer->data, zerobuf, sizeof (zerobuf)) == 0)) {
mm_serial_port_close (serial);
- port_probe_run_task_complete (task, FALSE, NULL);
+ port_probe_run_task_complete (self->priv->task,
+ FALSE,
+ g_error_new_literal (MM_CORE_ERROR,
+ MM_CORE_ERROR_FAILED,
+ "Probing stopped due to non-AT response"));
return;
}
@@ -913,7 +917,11 @@ serial_buffer_full (MMSerialPort *serial,
if (!memcmp (&buffer->data[i], *iter, iter_len)) {
/* Immediately close the port and complete probing */
mm_serial_port_close (serial);
- port_probe_run_task_complete (task, FALSE, NULL);
+ port_probe_run_task_complete (self->priv->task,
+ FALSE,
+ g_error_new_literal (MM_CORE_ERROR,
+ MM_CORE_ERROR_FAILED,
+ "Probing stopped due to non-AT response"));
return;
}
}