Fixed buffer length computation error in base64 encoding that resulted in buffer overruns.  This was easily reproducible with memory scribble and malloc guard enabled.