X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Futils.c;h=0d7bc02fac6371fb854685f60cb21120b1faabc4;hb=313a752cb5fbf27450d34c15b0085d2d8a4147af;hp=594c91a5f76dd0c7726ba83893d43d41443e854a;hpb=75e5b2e906bd8563bf0f53a76065618c88122e1c;p=tinc diff --git a/src/utils.c b/src/utils.c index 594c91a5..0d7bc02f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -75,7 +75,7 @@ int b64decode(const char *src, void *dst, int length) { 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)