base64: fix possible null pointer dereference