if(!port || !*port)
port = "655";
- if(!b64decode(slash, hash, 18) || !b64decode(slash + 24, cookie, 18))
+ if(!b64decode(slash, hash, 24) || !b64decode(slash + 24, cookie, 24))
goto invalid;
// Generate a throw-away key for the invitation.
uint32_t triplet = 0;
unsigned char *udst = (unsigned char *)dst;
- for(i = 0; i < length / 3 * 4 && src[i]; i++) {
+ for(i = 0; i < length && src[i]; i++) {
triplet |= base64_decode[src[i] & 0xff] << (6 * (i & 3));
if((i & 3) == 3) {
if(triplet & 0xff000000U)