Fixed base64_decode() reject empty input buffers
authorJouni Malinen <j@w1.fi>
Thu, 28 Feb 2008 01:49:59 +0000 (17:49 -0800)
committerJouni Malinen <j@w1.fi>
Thu, 28 Feb 2008 01:49:59 +0000 (17:49 -0800)
src/utils/base64.c

index 3407949..0eadb81 100644 (file)
@@ -115,7 +115,7 @@ unsigned char * base64_decode(const unsigned char *src, size_t len,
                        count++;
        }
 
-       if (count % 4)
+       if (count == 0 || count % 4)
                return NULL;
 
        olen = count / 4 * 3;