From cde70334b0f1d3306e2b04b3f7e636018758e932 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 26 Aug 2014 18:38:45 +0200 Subject: [PATCH] Initialize the fingerprint before use. The fingerprint is used unconditionally, regardless of whether it's explicitly set by the application or not. Therefore it needs to be initialized properly. --- src/cressi_edy.c | 1 + src/cressi_leonardo.c | 1 + src/diverite_nitekq.c | 1 + src/zeagle_n2ition3.c | 1 + 4 files changed, 4 insertions(+) diff --git a/src/cressi_edy.c b/src/cressi_edy.c index d5c5482..1de3b53 100644 --- a/src/cressi_edy.c +++ b/src/cressi_edy.c @@ -188,6 +188,7 @@ cressi_edy_device_open (dc_device_t **out, dc_context_t *context, const char *na // Set the default values. device->port = NULL; device->model = 0; + memset (device->fingerprint, 0, sizeof (device->fingerprint)); // Open the device. int rc = serial_open (&device->port, context, name); diff --git a/src/cressi_leonardo.c b/src/cressi_leonardo.c index 87a6412..b2df764 100644 --- a/src/cressi_leonardo.c +++ b/src/cressi_leonardo.c @@ -89,6 +89,7 @@ cressi_leonardo_device_open (dc_device_t **out, dc_context_t *context, const cha // Set the default values. device->port = NULL; + memset (device->fingerprint, 0, sizeof (device->fingerprint)); // Open the device. int rc = serial_open (&device->port, context, name); diff --git a/src/diverite_nitekq.c b/src/diverite_nitekq.c index 30692c6..e032fb6 100644 --- a/src/diverite_nitekq.c +++ b/src/diverite_nitekq.c @@ -164,6 +164,7 @@ diverite_nitekq_device_open (dc_device_t **out, dc_context_t *context, const cha // Set the default values. device->port = NULL; + memset (device->fingerprint, 0, sizeof (device->fingerprint)); // Open the device. int rc = serial_open (&device->port, context, name); diff --git a/src/zeagle_n2ition3.c b/src/zeagle_n2ition3.c index 16b42f5..5c077d4 100644 --- a/src/zeagle_n2ition3.c +++ b/src/zeagle_n2ition3.c @@ -152,6 +152,7 @@ zeagle_n2ition3_device_open (dc_device_t **out, dc_context_t *context, const cha // Set the default values. device->port = NULL; + memset (device->fingerprint, 0, sizeof (device->fingerprint)); // Open the device. int rc = serial_open (&device->port, context, name);