about summary refs log tree commit diff stats
path: root/src/xmpp/roster.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-04-17 22:37:21 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-04-17 22:37:21 +0200
commit8e588d67646a0d97dc3e15cb7b64bcf464f0e0ea (patch)
treec216f09c3392329cfd737d98d93da18ed19b6e6f /src/xmpp/roster.c
parent3ba38eafa8ff0a53937fafebc0f8754944d57601 (diff)
downloadprofani-tty-8e588d67646a0d97dc3e15cb7b64bcf464f0e0ea.tar.gz
Fix random string generation
Our variable `alphabet` contains 62 alphanumeric symbols + '\0'.
When we use sizeof(alphabet) we will get 63 due to that.
But we want to choose a random numbers from the 62 alphanumeric letters only.

This mistake caused us to have strings with a max length of `length`
instead of the exact length.

When doing https://github.com/profanity-im/profanity/issues/1520
this caused our algo for muc reflection to not catch since we expect the
random ID to be exactly 15 symbols long in `message_is_sent_by_us()`.
Diffstat (limited to 'src/xmpp/roster.c')
0 files changed, 0 insertions, 0 deletions