From ee0982bc1b86b8a2c79306ac394eeaad59ed3a80 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 24 Nov 2022 16:28:49 +0300 Subject: fix for buffer padding --- protocols/WhatsApp/src/utils.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'protocols/WhatsApp') diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp index b2fce4db09..05e9d2c3bc 100644 --- a/protocols/WhatsApp/src/utils.cpp +++ b/protocols/WhatsApp/src/utils.cpp @@ -296,9 +296,7 @@ void generateIV(uint8_t *iv, uint32_t &pVar) void padBuffer16(MBinBuffer &buf) { - uint8_t c = buf.length() % 16; - if (c == 0) - c = 16; + uint8_t c = 16 - buf.length() % 16; for (uint8_t i = 0; i < c; i++) buf.append(&c, 1); -- cgit v1.2.3