aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmi-firmware-update
diff options
context:
space:
mode:
authorChristophe Ronco <c.ronco@kerlink.fr>2017-01-17 09:17:42 +0100
committerAleksander Morgado <aleksander@aleksander.es>2017-01-17 09:59:36 +0100
commitce21b7464ee95b7bf2b64274b4b3f6b1d392c246 (patch)
treeaf4cad9fcb5beaf125e8069a4248228401418853 /src/qmi-firmware-update
parent7d942faea72679a6d3125a9127860400de11cfb3 (diff)
downloadexternal_libqmi-ce21b7464ee95b7bf2b64274b4b3f6b1d392c246.zip
external_libqmi-ce21b7464ee95b7bf2b64274b4b3f6b1d392c246.tar.gz
external_libqmi-ce21b7464ee95b7bf2b64274b4b3f6b1d392c246.tar.bz2
qmi-firmware-update: fix CRC checking
CRC is not well checked if there is an escape char in input buffer.
Diffstat (limited to 'src/qmi-firmware-update')
-rw-r--r--src/qmi-firmware-update/qfu-qdl-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmi-firmware-update/qfu-qdl-device.c b/src/qmi-firmware-update/qfu-qdl-device.c
index c90a778..2b2e6f1 100644
--- a/src/qmi-firmware-update/qfu-qdl-device.c
+++ b/src/qmi-firmware-update/qfu-qdl-device.c
@@ -191,7 +191,7 @@ hdlc_unframe (const guint8 *in,
j -= 2; /* remove the crc */
/* verify the crc */
- crc = qfu_utils_crc16 (in, j);
+ crc = qfu_utils_crc16 (out, j);
if (crc != (out[j] | out[j + 1] << 8)) {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"crc check failed: 0x%04x != 0x%04x\n", crc, out[j] | out[j + 1] << 8);