From c9e6a89aeaea87daaf572edefe3f9dc5d48e912e Mon Sep 17 00:00:00 2001 From: Stefan Kropp Date: Sat, 30 Apr 2022 22:10:21 +0200 Subject: Bugfix OX rpad generation ________________________________________ < No comment - should be much better now > ---------------------------------------- \ \ \ >()_ (__)__ _ --- src/xmpp/message.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/xmpp') diff --git a/src/xmpp/message.c b/src/xmpp/message.c index c18f9376..fb58285e 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -1616,11 +1616,13 @@ _openpgp_signcrypt(xmpp_ctx_t* ctx, const char* const to, const char* const text struct tm* tm = localtime(&now); char buf[255]; strftime(buf, sizeof(buf), "%FT%T%z", tm); - int randnr = rand() % 5; - char rpad_data[randnr]; - for (int i = 0; i < randnr - 1; i++) { - rpad_data[i] = 'c'; + // build rpad + int randnr = (rand() % 100) + 1; + char rpad_data[randnr]; + for (int i = 0; i < randnr; i++) { + int rchar = (rand() % 52) + 65; + rpad_data[i] = rchar; } rpad_data[randnr - 1] = '\0'; -- cgit 1.4.1-2-gfad0