Check for invalid input in encrypted buffers
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 21 Oct 2014 19:20:07 +0000 (21:20 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 21 Oct 2014 19:20:07 +0000 (21:20 +0200)
commit8b5ecd226f9208af3074b33d3b7cf5e14f55b138
treebd5462acec7abab025935c7ecdebccabf912c27e
parentd6888a62baaa3cbb5fcf461aafa1fbf5197c4f49
Check for invalid input in encrypted buffers

The ECB Blowfish decryption function assumed that encrypted input would
always come in blocks of 12 characters, as specified. However, buggy
clients or annoying people may not adhere to that assumption, causing
the core to crash while trying to process the invalid base64 input.

With this commit we make sure that we're not overstepping the bounds of
the input string while decoding it; instead we bail out early and display
the original input. Fixes #1314.

Thanks to Tucos for finding that one!
src/core/cipher.cpp