From c7a929a8a85544adf85593d9541286039133ce85 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 11 Mar 2024 07:30:02 +0100 Subject: [PATCH] Correctly initialize string in core/device.cpp When initializing a string with multiple characters, first comes the length, then the size. Not the other way around. Fixes #4127. Signed-off-by: Berthold Stoeger --- core/device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/device.cpp b/core/device.cpp index 05646df66..b6b435e84 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -296,7 +296,7 @@ std::string fp_get_data(struct fingerprint_table *table, unsigned int i) if (!table || i >= table->fingerprints.size()) return std::string(); struct fingerprint_record *fpr = &table->fingerprints[i]; - std::string res(' ', fpr->fsize * 2); + std::string res(fpr->fsize * 2, ' '); for (unsigned int i = 0; i < fpr->fsize; ++i) { res[2 * i] = to_hex_digit((fpr->raw_data[i] >> 4) & 0xf); res[2 * i + 1] = to_hex_digit(fpr->raw_data[i] & 0xf);